Skip to content

Commit e247f66

Browse files
committed
more
1 parent b48c12b commit e247f66

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

packages/svelte/src/internal/client/dom/blocks/boundary.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { queue_boundary_micro_task } from '../task.js';
2424
import * as e from '../../../shared/errors.js';
2525
import { DEV } from 'esm-env';
2626
import { from_async_derived, set_from_async_derived } from '../../reactivity/deriveds.js';
27+
import { active_fork, Fork } from '../../reactivity/forks.js';
2728

2829
/**
2930
* @typedef {{
@@ -114,6 +115,7 @@ export class Boundary {
114115
// boundary, and hydrate accordingly
115116
queueMicrotask(() => {
116117
this.#main_effect = this.#run(() => {
118+
Fork.ensure();
117119
return branch(() => this.#children(this.#anchor));
118120
});
119121

packages/svelte/src/internal/client/reactivity/deriveds.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/** @import { Derived, Effect, Source } from '#client' */
2+
/** @import { Fork } from './forks.js'; */
23
import { DEV } from 'esm-env';
34
import {
45
CLEAN,
@@ -123,14 +124,14 @@ export function async_derived(fn, location) {
123124

124125
var restore = capture();
125126

126-
var fork = active_fork;
127+
var fork = /** @type {Fork} */ (active_fork);
127128
var ran = boundary.ran;
128129

129130
if (should_suspend) {
130131
if (!ran) {
131132
boundary.increment();
132133
} else {
133-
fork?.increment();
134+
fork.increment();
134135
}
135136
}
136137

@@ -147,17 +148,13 @@ export function async_derived(fn, location) {
147148
if (!ran) {
148149
boundary.decrement();
149150
} else {
150-
fork?.decrement();
151+
fork.decrement();
151152
}
152153
}
153154

154-
if (fork !== null) {
155-
fork.run(() => {
156-
internal_set(signal, v);
157-
});
158-
} else {
155+
fork.run(() => {
159156
internal_set(signal, v);
160-
}
157+
});
161158

162159
if (DEV && location !== undefined) {
163160
recent_async_deriveds.add(signal);

0 commit comments

Comments
 (0)