holy shit it woooooorks

async-svelte-map
Rich Harris 6 months ago
parent 903eedb861
commit 95a0bec7c2

@ -387,16 +387,7 @@ export class Batch {
batch_values = null;
}
flush() {
var source_stacks = DEV ? new Set() : null;
try {
is_processing = true;
current_batch = this;
// we only reschedule previously-deferred effects if we expect
// to be able to run them after processing the batch
if (!this.#is_deferred()) {
#revive() {
for (const e of this.#dirty_effects) {
this.#maybe_dirty_effects.delete(e);
set_signal_status(e, DIRTY);
@ -409,6 +400,19 @@ export class Batch {
}
}
flush() {
var source_stacks = DEV ? new Set() : null;
try {
is_processing = true;
current_batch = this;
// we only reschedule previously-deferred effects if we expect
// to be able to run them after processing the batch
if (!this.#is_deferred()) {
this.#revive();
}
this.#process();
} finally {
flush_count = 0;
@ -487,12 +491,23 @@ export class Batch {
batch.#traverse(root, [], []);
}
// TODO do we need to do anything with the dummy effect arrays?
batch.#roots.length = 0;
}
batch.deactivate();
}
}
for (const batch of batches) {
if (batch.#blockers.has(this)) {
batch.#blockers.delete(this);
if (batch.#blockers.size === 0 && !batch.#is_deferred()) {
batch.#revive();
batch.#process();
}
}
}
}
/**
@ -562,8 +577,6 @@ export class Batch {
}
apply() {
this.#blockers.clear();
if (!async_mode_flag || (!this.is_fork && batches.size === 1)) {
batch_values = null;
return;

Loading…
Cancel
Save