-
-
Notifications
You must be signed in to change notification settings - Fork 617
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: setAtom uses stale pending on atom unmount #2811
base: main
Are you sure you want to change the base?
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. |
aac8cc5
to
c5bcf50
Compare
c5bcf50
to
20186ff
Compare
Preview in LiveCodesLatest commit: 772ba38
See documentations for usage instructions. |
20186ff
to
5fbd60e
Compare
5fbd60e
to
497cdd4
Compare
497cdd4
to
90d104c
Compare
90d104c
to
b16f8de
Compare
b16f8de
to
fe1d454
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch.
fe1d454
to
cbd63ec
Compare
cbd63ec
to
1d18417
Compare
1d18417
to
1d1dd57
Compare
1d1dd57
to
687380e
Compare
can't reopen. can't change the base branch. 😢 |
now, it's reopened. can you please resolve conflicts? |
1a0cb4e
to
0f0e1a2
Compare
0f0e1a2
to
2e41018
Compare
aa9cdb2
to
1d44255
Compare
Commit 2 changes this to use a mutable setAtom reference instead. Its cleaner but it adds an extra function call to the stack. |
Cool. I was thinking of hiding |
116bb80
to
bec7841
Compare
commit 6 adds a createRuntime to clean up the code a little more. |
Related Bug Reports or Discussions
setAtom uses stale pending on atom unmount (#2812)
Why is setAtom using a stale reference of pending?
Because setAtom is defined in mountAtom and references that function's pending.
Fix: dependency inject the current pending when invoking the pending functions
Check List
pnpm run prettier
for formatting code and docs