pull/17805/head
Rich Harris 6 months ago
parent b77304ae8e
commit 8ebea4313f

@ -186,12 +186,12 @@ export class Batch {
for (var e of tracked.d) {
set_signal_status(e, DIRTY);
schedule_effect(e);
this.schedule(e);
}
for (e of tracked.m) {
set_signal_status(e, MAYBE_DIRTY);
schedule_effect(e);
this.schedule(e);
}
}
}
@ -225,9 +225,9 @@ export class Batch {
current_batch = null;
if (legacy_updates.length > 0) {
Batch.ensure();
var next_batch = Batch.ensure();
for (const e of legacy_updates) {
schedule_effect(e);
next_batch.schedule(e);
}
}
@ -515,12 +515,12 @@ export class Batch {
for (const e of this.#dirty_effects) {
this.#maybe_dirty_effects.delete(e);
set_signal_status(e, DIRTY);
schedule_effect(e);
this.schedule(e);
}
for (const e of this.#maybe_dirty_effects) {
set_signal_status(e, MAYBE_DIRTY);
schedule_effect(e);
this.schedule(e);
}
this.flush();

@ -41,7 +41,7 @@ import { DEV } from 'esm-env';
import { define_property } from '../../shared/utils.js';
import { get_next_sibling } from '../dom/operations.js';
import { component_context, dev_current_component_function, dev_stack } from '../context.js';
import { Batch, collected_effects, schedule_effect } from './batch.js';
import { Batch, collected_effects } from './batch.js';
import { flatten, increment_pending } from './async.js';
import { without_reactive_context } from '../dom/elements/bindings/shared.js';
import { set_signal_status } from './status.js';
@ -129,8 +129,7 @@ function create_effect(type, fn) {
collected_effects.push(effect);
} else {
// schedule for later
Batch.ensure();
schedule_effect(effect);
Batch.ensure().schedule(effect);
}
} else if (fn !== null) {
try {

Loading…
Cancel
Save