Xia Chao 4 days ago committed by GitHub
commit 7344a0dc46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: avoid duplicate reaction when reconnecting a derived after its reader is hidden

@ -736,7 +736,10 @@ function reconnect(derived) {
if (derived.deps === null) return;
for (const dep of derived.deps) {
(dep.reactions ??= []).push(derived);
var reactions = (dep.reactions ??= []);
if (index_of.call(reactions, derived) === -1) {
reactions.push(derived);
}
if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
unfreeze_derived_effects(/** @type {Derived} */ (dep));

Loading…
Cancel
Save