pull/16625/head
Rich Harris 4 weeks ago
parent 2e02868ef1
commit 8d710765c2

@ -133,6 +133,7 @@ function create_effect(type, fn, sync, push = true) {
schedule_effect(effect); schedule_effect(effect);
} }
if (push) {
// if an effect has no dependencies, no DOM and no teardown function, // if an effect has no dependencies, no DOM and no teardown function,
// don't bother adding it to the effect tree // don't bother adding it to the effect tree
var inert = var inert =
@ -143,7 +144,7 @@ function create_effect(type, fn, sync, push = true) {
effect.teardown === null && effect.teardown === null &&
(effect.f & EFFECT_PRESERVED) === 0; (effect.f & EFFECT_PRESERVED) === 0;
if (!inert && push) { if (!inert) {
if (parent !== null) { if (parent !== null) {
push_effect(effect, parent); push_effect(effect, parent);
} }
@ -158,6 +159,7 @@ function create_effect(type, fn, sync, push = true) {
(derived.effects ??= []).push(effect); (derived.effects ??= []).push(effect);
} }
} }
}
return effect; return effect;
} }

Loading…
Cancel
Save