use update_derived_status, so that we never set a dep-less derived MAYBE_DIRTY

pull/17362/head
Rich Harris 3 weeks ago
parent ad382a4278
commit c7635f84df

@ -374,13 +374,15 @@ function remove_reaction(signal, dependency) {
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
(new_deps === null || !new_deps.includes(dependency))
) {
set_signal_status(dependency, MAYBE_DIRTY);
// If we are working with a derived that is owned by an effect, then mark it as being
// disconnected and remove the mark flag, as it cannot be reliably removed otherwise
if ((dependency.f & CONNECTED) !== 0) {
dependency.f ^= CONNECTED;
dependency.f &= ~WAS_MARKED;
}
update_derived_status(dependency);
// Disconnect any reactions owned by this reaction
destroy_derived_effects(/** @type {Derived} **/ (dependency));
remove_reactions(/** @type {Derived} **/ (dependency), 0);

Loading…
Cancel
Save