Closed betula closed 1 year ago
I really need this functionality, too.
In case of compositibility and easibility of usage, in some cases it's easier to use solidjs like Accessor
type Accessor<T> = () => T
Because its easy way to define lazy computation that will executed on demand. And you don't need to rely on rules of hooks. But for more flexible usage of this pattern, i need a way to turn off deps tracking on consumer side
Untracked
Necessary to implement a function that provides a possibility for disabling the tracking of dependencies.
It has already been implemented in Angular Signals and MobX.
What's the reason to use it?
For reading one signal without dependency creation the
peek
method already implement. Reading signals without subscribing to themBut it is not enough.
untracked
function provides the possibility for thereaction
pattern:In that pattern, you have a way to control your dependencies. The reaction will collect dependencies only from the sender function, and react only on them.
Many thanks to you, your signals implementation is amazing, I think the best at the moment.