|
|
@ -261,9 +261,10 @@ export function update_pre(source, d = 1) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {Value} signal
|
|
|
|
* @param {Value} signal
|
|
|
|
* @param {number} status should be DIRTY or MAYBE_DIRTY
|
|
|
|
* @param {number} status should be DIRTY or MAYBE_DIRTY
|
|
|
|
|
|
|
|
* @param {Value} [parent]
|
|
|
|
* @returns {void}
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export function mark_reactions(signal, status, only_boundary = false) {
|
|
|
|
export function mark_reactions(signal, status, parent, only_boundary = false) {
|
|
|
|
var reactions = signal.reactions;
|
|
|
|
var reactions = signal.reactions;
|
|
|
|
if (reactions === null) return;
|
|
|
|
if (reactions === null) return;
|
|
|
|
|
|
|
|
|
|
|
@ -281,9 +282,10 @@ export function mark_reactions(signal, status, only_boundary = false) {
|
|
|
|
if (!runes && reaction === active_effect) continue;
|
|
|
|
if (!runes && reaction === active_effect) continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (only_boundary) {
|
|
|
|
if (only_boundary) {
|
|
|
|
|
|
|
|
var effect = /** @type {Effect} */ (reaction);
|
|
|
|
if ((flags & DERIVED) === 0) {
|
|
|
|
if ((flags & DERIVED) === 0) {
|
|
|
|
var boundary = get_boundary(/** @type {Effect} */ (reaction));
|
|
|
|
var boundary = get_boundary(effect);
|
|
|
|
if (!boundary || (reaction.f & ASYNC_DERIVED) !== 0) {
|
|
|
|
if (!boundary || ((reaction.f & ASYNC_DERIVED) !== 0 && !(signal.v instanceof Promise))) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -292,7 +294,7 @@ export function mark_reactions(signal, status, only_boundary = false) {
|
|
|
|
if (boundary) {
|
|
|
|
if (boundary) {
|
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
var forks = boundary.fn.forks;
|
|
|
|
var forks = boundary.fn.forks;
|
|
|
|
if (reaction.deps?.every((d) => forks.has(d))) {
|
|
|
|
if (reaction.deps?.every((d) => forks.has(d)) || forks.has(parent)) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -309,7 +311,7 @@ export function mark_reactions(signal, status, only_boundary = false) {
|
|
|
|
// If the signal a) was previously clean or b) is an unowned derived, then mark it
|
|
|
|
// If the signal a) was previously clean or b) is an unowned derived, then mark it
|
|
|
|
if ((flags & (CLEAN | UNOWNED)) !== 0) {
|
|
|
|
if ((flags & (CLEAN | UNOWNED)) !== 0) {
|
|
|
|
if ((flags & DERIVED) !== 0) {
|
|
|
|
if ((flags & DERIVED) !== 0) {
|
|
|
|
mark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY, only_boundary);
|
|
|
|
mark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY, signal, only_boundary);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
schedule_effect(/** @type {Effect} */ (reaction));
|
|
|
|
schedule_effect(/** @type {Effect} */ (reaction));
|
|
|
|
}
|
|
|
|
}
|
|
|
|