async-changeset
Rich Harris 7 months ago
parent 5ddcc3e91c
commit 81565fe818

@ -374,6 +374,8 @@ export class Boundary {
} }
export class Fork { export class Fork {
suspended = false;
/** @type {Boundary} */ /** @type {Boundary} */
#boundary; #boundary;
@ -459,14 +461,14 @@ export class Fork {
} }
increment() { increment() {
this.#pending_count++; if (this.#pending_count++ === 0) {
this.suspended = true; this.suspended = true;
}
} }
decrement() { decrement() {
if (--this.#pending_count === 0) { if (--this.#pending_count === 0) {
this.suspended = false; this.suspended = false;
// this.commit();
} }
} }

@ -359,6 +359,7 @@ export function template_effect(fn, sync = [], async = [], d = derived) {
} }
create_template_effect(fn, [...sync.map(d), ...result]); create_template_effect(fn, [...sync.map(d), ...result]);
schedule_effect(effect);
unsuspend(); unsuspend();
}); });

Loading…
Cancel
Save