Subscribe on changes. #530
-
I found it very useful to use But when I using it like this
and modify 2 different stores at the same time, the above component will re-render 2 times. Are there any options to have the re-render fire once if both stores have changed? |
Beta Was this translation helpful? Give feedback.
Answered by
dai-shi
Aug 24, 2022
Replies: 1 comment 6 replies
-
How about this? const { store1: snap1, store2: snap2 } = useSnapshot(useMemo(() => proxy({ store1, store2 }), []); If possible, I'd define |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
nosferatu500
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about this?
If possible, I'd define
proxy({ store1, store2 })
outside component.