diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index c440b7df0b..f881330e90 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -300,7 +300,15 @@ export class Batch { deactivate() { current_batch = null; - flush_pending_update(); + for (const update of effect_pending_updates) { + effect_pending_updates.delete(update); + update(); + + if (current_batch !== null) { + // only do one at a time + break; + } + } } neuter() { @@ -427,18 +435,6 @@ export class Batch { } } -function flush_pending_update() { - for (const update of effect_pending_updates) { - effect_pending_updates.delete(update); - update(); - - if (current_batch !== null) { - // only do one at a time - break; - } - } -} - /** * Synchronously flush any pending updates. * Returns void if no callback is provided, otherwise returns the result of calling the callback.