async-changeset
Rich Harris 7 months ago
parent 5235642729
commit 00990ad1f6

@ -30,6 +30,7 @@ import { queue_boundary_micro_task } from '../task.js';
import * as e from '../../../shared/errors.js';
import { DEV } from 'esm-env';
import { from_async_derived, set_from_async_derived } from '../../reactivity/deriveds.js';
import { changeset } from '../../reactivity/sources.js';
/**
* @typedef {{
@ -317,10 +318,9 @@ export class Boundary {
}
/**
* @param {Set<Source>} changeset
* @param {(fork: Fork) => void} fn
*/
fork(changeset, fn) {
fork(fn) {
if (!active_fork || !this.#forks.has(active_fork)) {
active_fork = new Fork(this, changeset);
this.#forks.add(active_fork);
@ -328,10 +328,7 @@ export class Boundary {
fn(active_fork);
if (!active_fork.suspended) {
active_fork.commit();
}
active_fork.commit();
active_fork = null;
}
@ -427,8 +424,6 @@ export class Fork {
return;
}
this.suspended = false;
for (const e of this.#render_effects) {
try {
// if (check_dirtiness(e)) {
@ -458,15 +453,11 @@ export class Fork {
}
increment() {
if (this.#pending_count++ === 0) {
this.suspended = true;
}
this.#pending_count += 1;
}
decrement() {
if (--this.#pending_count === 0) {
this.suspended = false;
}
this.#pending_count -= 1;
}
discard() {

@ -832,7 +832,7 @@ function process_effects(effect, fork) {
set_signal_status(current_effect, CLEAN);
}
} else if ((flags & BOUNDARY_EFFECT) !== 0) {
/** @type {Boundary} */ (current_effect.b).fork(changeset, (fork) => {
/** @type {Boundary} */ (current_effect.b).fork((fork) => {
process_effects(/** @type {Effect} */ (current_effect), fork);
});
} else if ((flags & EFFECT) !== 0) {

Loading…
Cancel
Save