all non-unit tests passing

pull/17116/head
Rich Harris 2 weeks ago
parent c9d26db23f
commit db21188d4a

@ -369,11 +369,7 @@ export function update_derived(derived) {
if (batch_values !== null) {
batch_values.set(derived, derived.v);
} else {
var status =
(skip_reaction || (derived.f & CONNECTED) === 0) && derived.deps !== null
? MAYBE_DIRTY
: CLEAN;
var status = (derived.f & CONNECTED) === 0 ? MAYBE_DIRTY : CLEAN;
set_signal_status(derived, status);
}
}

@ -32,7 +32,8 @@ import {
EFFECT_PRESERVED,
STALE_REACTION,
USER_EFFECT,
ASYNC
ASYNC,
CONNECTED
} from '#client/constants';
import * as e from '../errors.js';
import { DEV } from 'esm-env';
@ -102,7 +103,7 @@ function create_effect(type, fn, sync, push = true) {
deps: null,
nodes_start: null,
nodes_end: null,
f: type | DIRTY,
f: type | DIRTY | CONNECTED,
first: null,
fn,
last: null,

@ -272,7 +272,7 @@ export function update_reaction(reaction) {
reaction.deps = deps = new_deps;
}
if (is_updating_effect) {
if (is_updating_effect && (reaction.f & CONNECTED) !== 0) {
for (i = skipped_deps; i < deps.length; i++) {
(deps[i].reactions ??= []).push(reaction);
}
@ -626,6 +626,15 @@ export function get(signal) {
if (is_dirty(derived)) {
update_derived(derived);
}
// reconnect a disconnected derived to the graph
if (is_updating_effect && (derived.f & CONNECTED) === 0 && derived.deps !== null) {
derived.f |= CONNECTED;
for (const dep of derived.deps) {
(dep.reactions ??= []).push(derived);
}
}
}
if (batch_values?.has(signal)) {

Loading…
Cancel
Save