-
-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: should update dependents with the value of the unwrapped atom when the promise resolves #2936
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Preview in LiveCodesLatest commit: 7e9d125
See documentations for usage instructions. |
commit: |
This is such a fundamental thing... I'll take it over. I'll push some commits to #2920. |
Related Bug Reports or Discussions
Fix #2914
Summary
Caused by 34b4f8e and e777f46
It's caused by a subtle timing issue. The promise is resolved before the derived atom is mounted because the mount process runs after the promise is resolved.
There might be a better fix, but for now in this PR, it triggers updates again if it finds atom value change after the mount process. More refactors for store.ts are coming and we may revisit this in the future.
Check List
pnpm run fix:format
for formatting code and docs