Skip to content

Commit 8bedfc7

Browse files
committed
cleaner apporach
1 parent ca2751b commit 8bedfc7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/svelte/src/internal/client/runtime.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ export function check_dirtiness(reaction) {
197197
if (dependencies !== null) {
198198
var i;
199199
var dependency;
200+
var is_disconnected = (flags & DISCONNECTED) !== 0;
200201
var depedency_needs_linking =
201-
(flags & DISCONNECTED) !== 0 || (is_unowned && active_effect !== null && !skip_reaction);
202+
is_disconnected || (is_unowned && active_effect !== null && !skip_reaction);
202203

203204
// If we are working with a disconnected or an unowned signal as part of an effect (due to !skip_reaction)
204205
// then we need to re-connect the reaction to the dependency
@@ -211,7 +212,9 @@ export function check_dirtiness(reaction) {
211212
}
212213
}
213214

214-
reaction.f ^= DISCONNECTED;
215+
if (is_disconnected) {
216+
reaction.f ^= DISCONNECTED;
217+
}
215218
}
216219

217220
for (i = 0; i < dependencies.length; i++) {

0 commit comments

Comments
 (0)