Description
Describe the bug
Not sure if this is a bug or intended. According to this breaking change, if the state caused an $effect to rerun, Svelte should provide the previous value of the state in the teardown function. This work for $state currently, but not for $derived, though it does work if $derived is reassigned.
Reproduction
Logs
System Info
Svelte playground (5.33.18)
Chrome 137.0.7151.56
Severity
annoyance