Replies: 1 comment 2 replies
-
|
As you implied, this is the expected limited behavior with notifyInSync=false. By the way, you might be interested in https://github.com/valtiojs/valtio-reactive. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If you do a paired unsubscribe/resubscribe (how you might do it with a changing callback in a useEffect), you can miss non-synchronous events. See this test case:
In fact, you won't be notified - because the unsubscribed one had the change in it, and it got blown away and not-sent, and the new subscription, after the fact, won't.
I think the right answer is for sync to default to true instead of false. It's totally reasonable to design around this behavior if you are opting in to it, but it's a bit tougher when you're not.
Beta Was this translation helpful? Give feedback.
All reactions