5 ms·
What about scoped reactivity? Sometimes you need to react on some of the states not all of them. Right now we are achieving this by passing function with argume
by wikoj1021 3y ago
What about scoped reactivity? Sometimes you need to react on some of the states not all of them. Right now we are achieving this by passing function with arguments to react on to $: but with $derived and $effect it seems to be not possible because it takes variables from every function passed. Are there any plans how to resolve this? Also nested $effect instead of onMount looks awfull and to be honest is less readable.
- mkishi 3y agoYou can use `untrack` [1] when you don't want to react to some state inside an effect. You can still use `onMount`. It's not deprecated [2], although `$effect` could be used similarly going forward. [1] https://svelte-5-preview.vercel.app/docs/functions#untrack https://svelte-5-preview.vercel.app/docs/functions#untrack [2] https://svelte-5-preview.vercel.app/docs/runes#$effect-what-this-replaces https://svelte-5-preview.vercel.app/docs/runes#$effect-what-...