unwrap returns inconsistent values when async atom resolves
#3239
Replies: 1 comment
-
|
Sorry, I only searched Issues and didn't notice this Discussion earlier. I understand this is an intended change, but the |
Beta Was this translation helpful? Give feedback.
0 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.
-
Bug Description
Since v2.10, when an async atom resolves, different
unwrapatoms may show inconsistent values at the same moment. Specifically, a globally definedunwrappedAtommay returnundefinedeven though the same async atom has already resolved and anotherunwrapinstance has received the value. This behavior did not occur in v2.9.Reproduction Code
Expected Behavior
The console should never show
unwrappedAtom result: undefined.Actual Behavior
The console initially shows
unwrappedAtom result: undefined, then later showsunwrappedAtom result: { data: 'Hello, World!' }.Reproduction Link
https://codesandbox.io/p/sandbox/6lvjqt
Beta Was this translation helpful? Give feedback.
All reactions