Scratching your head over Svelte 5’s new runes—especially $derived vs $effect?
You’re not alone. This app and blog unpacks why they confuse devs and how mastering them makes your state logic crystal‑clear.
You’re not alone. This app and blog unpacks why they confuse devs and how mastering them makes your state logic crystal‑clear.
Comments
$effect = side‑effects only
In my water‑tracker:
– $derived counts filled glasses & last‑drink time
– $effect persists data to localStorage
Right tool, right job ➜ cleaner, predictable code.
Because derived takes a pure function and effect takes the literal opposite. Side effects only.
Blog --> https://htmlallthethings.com/blog-posts/understanding-svelte-5-runes-derived-vs-effect
Code --> https://github.com/mikhail-karan/water-tracker-svelte5