File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ let queued_root_effects = [];
5959let last_scheduled_effect = null ;
6060
6161let is_flushing = false ;
62- let in_flush_sync = false ;
6362
6463export class Batch {
6564 /**
@@ -417,7 +416,7 @@ export class Batch {
417416 return ( this . #deferred ??= deferred ( ) ) . promise ;
418417 }
419418
420- static ensure ( ) {
419+ static ensure ( in_flush_sync = false ) {
421420 if ( current_batch === null ) {
422421 const batch = ( current_batch = new Batch ( ) ) ;
423422 batches . add ( current_batch ) ;
@@ -446,15 +445,13 @@ export class Batch {
446445 * @returns {T }
447446 */
448447export function flushSync ( fn ) {
449- in_flush_sync = true ;
450-
451448 if ( async_mode_flag && active_effect !== null ) {
452449 e . flush_sync_in_effect ( ) ;
453450 }
454451
455452 var result ;
456453
457- const batch = Batch . ensure ( ) ;
454+ const batch = Batch . ensure ( true ) ;
458455
459456 if ( fn ) {
460457 batch . flush_effects ( ) ;
@@ -478,8 +475,6 @@ export function flushSync(fn) {
478475 dev_effect_stack = [ ] ;
479476 }
480477
481- in_flush_sync = false ;
482-
483478 return /** @type {T } */ ( result ) ;
484479 }
485480
You can’t perform that action at this time.
0 commit comments