Skip to content

Commit

Permalink
fix: improve unowned derived performance (#14724)
Browse files Browse the repository at this point in the history
* fix: improve unowned derived performance

* fix: improve unowned derived performance

* changeset
  • Loading branch information
trueadm authored Dec 16, 2024
1 parent bbf3829 commit 699dc6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-worms-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: improve unowned derived performance
5 changes: 3 additions & 2 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ export function check_dirtiness(reaction) {
}
}

// Unowned signals should never be marked as clean.
if (!is_unowned) {
// Unowned signals should never be marked as clean unless they
// are used within an active_effect without skip_reaction
if (!is_unowned || (active_effect !== null && !skip_reaction)) {
set_signal_status(reaction, CLEAN);
}
}
Expand Down

0 comments on commit 699dc6e

Please sign in to comment.