From 9b89b57558a76bb6d5f580af39b8b7747290ac29 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 15 Jul 2025 19:01:18 -0400 Subject: [PATCH] inline --- .../src/internal/client/reactivity/batch.js | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) 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.