pull/17805/head
Rich Harris 2 months ago
parent cabc117c7d
commit 1b0e1f4e55

@ -217,6 +217,11 @@ export class Batch {
reset_branch(e, t);
}
} else {
// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with
// newly updated sources, which could lead to infinite loops when effects run over and over again.
previous_batch = this;
current_batch = null;
// append/remove branches
for (const fn of this.#commit_callbacks) fn(this);
this.#commit_callbacks.clear();
@ -225,11 +230,6 @@ export class Batch {
this.#commit();
}
// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with
// newly updated sources, which could lead to infinite loops when effects run over and over again.
previous_batch = this;
current_batch = null;
flush_queued_effects(render_effects);
flush_queued_effects(effects);
@ -369,6 +369,7 @@ export class Batch {
if (batches.size > 1) {
this.previous.clear();
var previous_batch = current_batch;
var previous_batch_values = batch_values;
var is_earlier = true;
@ -432,7 +433,7 @@ export class Batch {
}
}
current_batch = null;
current_batch = previous_batch;
batch_values = previous_batch_values;
}

Loading…
Cancel
Save