How to have an effect that does not subscribe to the signal's values?
I have this effect: https://github.com/nikitavoloboev/kuskus/blob/main/src/components/Page.tsx#L15
Namely above code that when I press Backspace key, it enters into infinite loop that breaks the app.
The doc of the package says I should put it in effect however: https://www.npmjs.com/package/@solid-primitives/keyboard
So I am not sure how to get around this issue. Is there way to stop the subscribing to
todos()
?10 Replies
You can use
untrack
to disable tracking for todos
signal or on
to specify dependencies for the effectSolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
SolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
this is nice thank you
although one thing I dont fully get from reading docs
I need to activate todos() somehow in that untrack function?
actually that did not work either
will try on now
You need to untrack in the setTodos
should i wrap the whole thing in untrack?
Sure
that worked wow
ok think I got it, thanks ❤️