You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last line of https://svelte.dev/tutorial/svelte/derived-state says, "Unlike normal state, derived state is read-only." This is no longer true as of Svelte v5.25.0: sveltejs/svelte#15570 made it possible to temporarily override derived state with a new value (though any time the underlying state changes and the derived calculation re-runs the temporary override will be replaced with a calculated value again).
Describe the proposed solution
We should probably update the tutorial to give an example of overriding derived state and having it go back to its derived state when re-computed. Perhaps a simple counter with a derived double value, and a few buttons that can set the doubled value to 5, 15, or 25. That way it will be easy to observe that the derived value is overridden when set, but that it goes back to a computed value whenever the underlying value changes again.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered:
Describe the problem
The last line of https://svelte.dev/tutorial/svelte/derived-state says, "Unlike normal state, derived state is read-only." This is no longer true as of Svelte v5.25.0: sveltejs/svelte#15570 made it possible to temporarily override derived state with a new value (though any time the underlying state changes and the derived calculation re-runs the temporary override will be replaced with a calculated value again).
Describe the proposed solution
We should probably update the tutorial to give an example of overriding derived state and having it go back to its derived state when re-computed. Perhaps a simple counter with a derived double value, and a few buttons that can set the doubled value to 5, 15, or 25. That way it will be easy to observe that the derived value is overridden when set, but that it goes back to a computed value whenever the underlying value changes again.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: