merge-batches
Rich Harris 22 hours ago
parent cb6e8244ae
commit ecdfd5b40c

@ -350,8 +350,6 @@ export class Batch {
this.#callbacks.clear();
if (batches.size > 1) {
const effects = new Set();
/**
* @param {Value} value
* @param {Set<Effect>} effects
@ -370,18 +368,25 @@ export class Batch {
}
};
for (const source of this.current.keys()) {
// TODO do we also need block effects?
get_async_effects(source, effects);
}
this.#previous.clear();
let is_earlier = true;
for (const batch of batches) {
if (batch === this) {
is_earlier = true;
continue;
}
const effects = new Set();
for (const source of this.current.keys()) {
if (is_earlier && batch.current.has(source)) continue;
// TODO do we also need block effects?
get_async_effects(source, effects);
}
if (effects.size > 0) {
current_batch = batch;
const revert = Batch.apply(batch);
for (const e of effects) {
@ -389,6 +394,7 @@ export class Batch {
}
revert();
}
}
current_batch = null;
}

Loading…
Cancel
Save