fix: flush batches whenever an async value resolves

pull/16912/head
Rich Harris 2 days ago
parent acdd93053d
commit 1ab675f717

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: flush batches whenever an async value resolves

@ -375,21 +375,17 @@ export class Batch {
decrement() { decrement() {
this.#pending -= 1; this.#pending -= 1;
if (this.#pending === 0) { for (const e of this.#dirty_effects) {
for (const e of this.#dirty_effects) { set_signal_status(e, DIRTY);
set_signal_status(e, DIRTY); schedule_effect(e);
schedule_effect(e); }
}
for (const e of this.#maybe_dirty_effects) {
set_signal_status(e, MAYBE_DIRTY);
schedule_effect(e);
}
this.flush(); for (const e of this.#maybe_dirty_effects) {
} else { set_signal_status(e, MAYBE_DIRTY);
this.deactivate(); schedule_effect(e);
} }
this.flush();
} }
/** @param {() => void} fn */ /** @param {() => void} fn */

Loading…
Cancel
Save