Merge branch 'each-block-pending' into async-svelte-set

async-svelte-set-alternative
Rich Harris 6 months ago
commit 1e6d87de9b

@ -528,9 +528,7 @@ export class Batch {
this.#pending -= 1; this.#pending -= 1;
if (blocking) this.#blocking_pending -= 1; if (blocking) this.#blocking_pending -= 1;
if (this.#decrement_queued || skip) { if (this.#decrement_queued || skip) return;
return;
}
this.#decrement_queued = true; this.#decrement_queued = true;
@ -587,20 +585,14 @@ export class Batch {
// we need to override values with the ones in this batch... // we need to override values with the ones in this batch...
batch_values = new Map(this.current); batch_values = new Map(this.current);
var is_earlier = true; // ...and undo changes belonging to other batches unless they block this one
// ...and undo changes belonging to other batches
// that don't coincide with this batch
for (const batch of batches) { for (const batch of batches) {
if (batch === this) { if (batch === this) continue;
is_earlier = false;
continue;
}
var intersects = false; var intersects = false;
var differs = false; var differs = false;
if (is_earlier) { if (batch.id < this.id) {
for (const source of batch.current.keys()) { for (const source of batch.current.keys()) {
intersects ||= this.current.has(source); intersects ||= this.current.has(source);
differs ||= !this.current.has(source); differs ||= !this.current.has(source);

Loading…
Cancel
Save