apply needs to happen before commit callbacks because they can create new batches, causing bugs

async-another-try
Simon Holthausen 2 weeks ago
parent 70bb532c0d
commit 4bdf9e3db4
No known key found for this signature in database

@ -465,11 +465,12 @@ export class Batch {
this.#dirty_effects.clear(); this.#dirty_effects.clear();
this.#maybe_dirty_effects.clear(); this.#maybe_dirty_effects.clear();
this.apply(true);
// append/remove branches // append/remove branches
for (const fn of this.#commit_callbacks) fn(this); for (const fn of this.#commit_callbacks) fn(this);
this.#commit_callbacks.clear(); this.#commit_callbacks.clear();
this.apply(true);
previous_batch = this; previous_batch = this;
flush_queued_effects(render_effects); flush_queued_effects(render_effects);
flush_queued_effects(effects); flush_queued_effects(effects);

Loading…
Cancel
Save