Recommended way to track the setter of a signal?
Currently, my solution involves wrapping the setter with a function. Playground: https://playground.solidjs.com/anonymous/cae5fd4e-3505-42f3-84a2-af62cc5b2d91
I am aware of
createEffect(on(...))
, but it may be excessive to create multiple effects solely for target signals.
With that in mind, what would be the recommended method in this case?Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
2 Replies
The behavior of using an effect vs a callback is slightly different (see the docs about batch, and additionally effects (though not memos) are deferred under suspense until the suspense resolves
But these are basically your options, depends on what you prefer
Thanks for your suggestion! I will look into it