-
-
Notifications
You must be signed in to change notification settings - Fork 702
fix: derived atom is not recomputed after its dependencies changed #2906 #2907
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
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. |
commit: |
12fd3bf to
ed9cfc9
Compare
ed9cfc9 to
8d02414
Compare
|
| Playground | Link |
|---|---|
| React demo | https://livecodes.io?x=id/FS5CSAWQF |
See documentations for usage instructions.
|
Size Change: 0 B Total Size: 91.9 kB ℹ️ View Unchanged
|
8d02414 to
f7b8170
Compare
32b1eb5 to
ba3075a
Compare
|
Thanks for working on it! I'll have a deeper look later. |
|
This does seem to fix the issue, but as you might expected it, I'm not a big fan of this change. (And, I didn't like |
0245b72 to
99515ad
Compare
00c8a20 to
28a45f6
Compare
28a45f6 to
479fa92
Compare
aea5843 to
dd8604c
Compare
a2555a4 to
3bca1c8
Compare
3bca1c8 to
a899d20
Compare
a899d20 to
9e1c4b7
Compare
9e1c4b7 to
59f4f46
Compare
59f4f46 to
8ebb8f0
Compare
dai-shi
left a comment
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.
Sorry for taking so much time.
Related Bug Reports or Discussions
#2906
Summary
When a writable atom sets two different atoms, and another atom indirectly depends on both, the dependent atom may fail to update correctly. Specifically, if the first atom's update results in no actual change, the dependent atom's "dirty bit" gets cleared prematurely. Then, when the second
finishRecomputeexecutes, the dependent atom does not recompute because its dirty bit was already cleared.The proposed solution in this PR is to consolidate all
finishRecomputeoperations into a single process, thereby handling changes to the atom graph in one go.Check List
pnpm run prettierfor formatting code and docs