File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { queue_boundary_micro_task } from '../task.js';
2424import * as e from '../../../shared/errors.js' ;
2525import { DEV } from 'esm-env' ;
2626import { 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
Original file line number Diff line number Diff line change 11/** @import { Derived, Effect, Source } from '#client' */
2+ /** @import { Fork } from './forks.js'; */
23import { DEV } from 'esm-env' ;
34import {
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 ) ;
You can’t perform that action at this time.
0 commit comments