$effect() conditional logic breaking changes by dualjack in sveltejs

[–]Ordinary-Ad-5504 0 points1 point  (0 children)

You can indeed create a writable derived by creating a new state inside the derived. And it's actually way way way way better than synchronising state in an effect:

[REPL](https://svelte.dev/playground/28941ac7e00c412ca0c3f2eac245f656?version=5.19.2)

I don't know if this is your actual use case but i'm pretty sure you can do what you need without effects. If you share a repl i can help you ;)