File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -472,11 +472,14 @@ export function flushSync(fn) {
472
472
batch . flush ( ) ;
473
473
}
474
474
475
- // this would be reset in `batch.flush_effects()` but since we are early returning here,
476
- // we need to reset it here as well in case the first time there's 0 queued root effects
477
- last_scheduled_effect = null ;
475
+ // TODO this feels wrong
476
+ if ( queued_root_effects . length === 0 ) {
477
+ // this would be reset in `batch.flush_effects()` but since we are early returning here,
478
+ // we need to reset it here as well in case the first time there's 0 queued root effects
479
+ last_scheduled_effect = null ;
478
480
479
- return /** @type {T } */ ( result ) ;
481
+ return /** @type {T } */ ( result ) ;
482
+ }
480
483
}
481
484
482
485
batch . flush_effects ( ) ;
You can’t perform that action at this time.
0 commit comments