-
-
Notifications
You must be signed in to change notification settings - Fork 612
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(unstable_derive): trap atom methods #2741
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. |
Size Change: +392 B (+0.44%) Total Size: 89.3 kB
ℹ️ View Unchanged
|
Preview in LiveCodesLatest commit: 7601858
See documentations for usage instructions. |
* fix(unstable_derive): add tests * test(unstable_derive): add failing test
I like the atomOnMount trap. I'm not sure about removing originalAtomState just yet though. It could be important for jotai-scope if it could be used to reliably resolve atomState. Earlier implementation was consistent for readAtomState and writeAtomState, but inconsistent / missing in other cases such as subscribe. |
Co-authored-by: David Maskasky <[email protected]>
As it's technically impossible to solve missing cases, I think it was an insufficient idea. Let's drop it and merge this. |
Yes I agree. |
This enables to trap
atom.read
,atom.write
andatom.onMount
.This eliminates
originAtomState
forgetAtomState
.