Skip to content

Catchall callback on state updates? #382

Answered by ryansolid
kfrp asked this question in Q&A
Discussion options

You must be logged in to vote

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 for console.logs

See it in action here: https://github.com/ryansolid/solid-todomvc/blob/master/src/index.jsx#L16

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ryansolid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants