Replies: 1 comment
-
This could be reported as an issue since there is a perceived inconsistency. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure if this is a bug or not, but this is related to this merge request (released 5.23.0).
I have example code and a repl below.
If an effect re-runs because the value of a
$derived()
changes, the value of the$derived()
in the teardown function is the current value. This is different if you replace the$derived()
with a$state()
. In this latter case, the value of the$state()
in the teardown function is the previous value.As is typical, the wording in the docs is very terse, making it unclear to me whether or not this is a design choice, or a bug. Some insight into this would be much appreciated. Thanks!
repl
Beta Was this translation helpful? Give feedback.
All reactions