-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
refactor(vanilla): simplify store impl #2029
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. Latest deployment of this branch, based on commit 89a9527:
|
Size Change: -64 B (0%) Total Size: 67.9 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.
I think this PR is okay to merge as is.
Array.from(atomState.d).every( | ||
([a, s]) => a === atom || readAtomState(a) === s | ||
) | ||
) { | ||
return atomState |
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.
I hope to remove this for #1901, but this breaks various behavior including async atoms on mount. Hope to revisit it in the far future.
mountedMap.set(atom, mounted) | ||
if (import.meta.env?.MODE !== 'production') { | ||
mountedAtoms.add(atom) | ||
} |
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.
It feels like our mountAtom
has room for improvement (like propagating changed
from dependencies).
It might be related with the previous comment, but not sure.
This is to fix the hack in #2016.
As we update state wisely in #1956, we should be able to skip things.Hopefully, this will improve the issue in #1901.