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
feat(core): Move useAtomValue and useSetAtom to core #989
Conversation
Move useAtomValue and useSetAtom to core
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pmndrs/jotai/3a9FGaH87YBRzfecnByEPna4CEAk |
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 261fe97:
|
Size Change: +367 B (0%) Total Size: 130 kB
ℹ️ View Unchanged
|
@dai-shi @sandren I have yet to change the docs, because I'm unsure how we want to tackle it. If not, where do we want to place the sections about I think we should leave a section in Let me know your thoughts. |
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.
Cool. Added some comments. Surprised with the number of files changed, and found they are tests. 😅
It can be another PR, but we would like to do it soon. I'm not merging this PR soon, so until then we can work on docs in this PR. So, my idea is to modify this page https://jotai.org/docs/basics/primitives.
It's important to show that first thing to learn is atom/useAtom, and only reach to the additional APIs, when necessary. Also, modify the API page: https://jotai.org/docs/api/core As for Utils, we don't deprecate useAtomValue/useUpdateAtom in |
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 nits, but important. Please also check the conflicts.
☝️ This is an error from Vercel deploy log. Seems like a tough one? cc @sandren |
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.
Cool. This should be ready.
Let's work on docs in a separate PR.
This change renames
useUpdateAtom
touseSetAtom
and movesuseAtomValue
anduseSetAtom
to core.The hooks are still exported from
jotai/utils
with original names for backwards compatibility.