-
-
Notifications
You must be signed in to change notification settings - Fork 622
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(core): Bail out of atom.write when atom update and current value are equal #878
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/jotai/4uTjLF441ENN7W5dE37GdVxYLATU |
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. Latest deployment of this branch, based on commit 45e60f6:
|
Size Change: +39 B (0%) Total Size: 41.7 kB
ℹ️ View Unchanged
|
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.
Great work!!!
So, setAtomPromiseOrValue bails out for non-promise values, but we are invoking invalidateDependents anyway, which causes this behavior. This is partly my intention, but overlooked the reported behavior.
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.
Thanks again for this! This is new to me and motivates me to investigate some more, because I feel like having some other bugs. I will try.
Fixes #877.