How to listen to all changes to a store? #2058
-
Consider a use-case where a store needs to be processed as a whole whenever any change is made to it. To make it support batching, my idea was to use a I'm able to achieve this by listening to createEffect(on(
() => JSON.stringify(store),
(s) => console.log(`JSON.stringify(store): ${s}`),
{ defer: true }
)); Here's a playground I setup with a few Is there a more succinct way of doing this? Using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Simply wrap the setter. If that's not possible, use |
Beta Was this translation helpful? Give feedback.
Simply wrap the setter. If that's not possible, use
@solid-primitives/deep
.