-
In the case of a somewhat nested/complex state with many granular updates, is there an approach for triggering a catchall callback that triggers on every state update? For example if I always want to keep the state synced in localState, etc. Like a Apologies if this has been addressed before. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The only way to do this is really listen to every reactive atom. If I was to do this under the hood that is all I'd be doing, but I'd need to add a new syntax to indicate this or special case helpers. I have a trick I do in TodoMVC for this exact problem. See it in action here: https://github.com/ryansolid/solid-todomvc/blob/master/src/index.jsx#L16 |
Beta Was this translation helpful? Give feedback.
The only way to do this is really listen to every reactive atom. If I was to do this under the hood that is all I'd be doing, but I'd need to add a new syntax to indicate this or special case helpers. I have a trick I do in TodoMVC for this exact problem.
JSON.stringify
will touch every property. I also use this trick forconsole.log
sSee it in action here: https://github.com/ryansolid/solid-todomvc/blob/master/src/index.jsx#L16