We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
$effect
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependencies are always unclear in Svelte, and Svelte 5 has causes some new infinite loops as mentioned in #13192. See also #12908.
Just like useEffect in React, I would like to use the optional second argument of the $effect rune to specify dependencies and untrack other states:
useEffect
$effect(() => { // your logic }, [a, b, c]);
Basically this is a shorthand of:
$effect(() => { void a; void b; void c; untrack(() => { // your logic }); });
(I usually use void to explicitly specify dependencies)
void
would make my life easier
The text was updated successfully, but these errors were encountered:
Closing as duplicate of #9248
Sorry, something went wrong.
No branches or pull requests
Describe the problem
Dependencies are always unclear in Svelte, and Svelte 5 has causes some new infinite loops as mentioned in #13192. See also #12908.
Describe the proposed solution
Just like
useEffect
in React, I would like to use the optional second argument of the$effect
rune to specify dependencies and untrack other states:Basically this is a shorthand of:
(I usually use
void
to explicitly specify dependencies)Importance
would make my life easier
The text was updated successfully, but these errors were encountered: