Skip to content

Commit

Permalink
fix: ensure disconnected deriveds correctly connect again
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Jan 5, 2025
1 parent b94b71c commit e95c94f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ export function check_dirtiness(reaction) {
for (i = 0; i < length; i++) {
dependency = dependencies[i];

// We always re-add all reactions (even duplicates) if the derived was
// previously disconnected
if (is_disconnected || !dependency?.reactions?.includes(reaction)) {
(dependency.reactions ??= []).push(reaction);
}
Expand Down

0 comments on commit e95c94f

Please sign in to comment.