-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
[Not For Merge] BREAKING: unmount async dependencies #2940
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: |
Size Change: -158 B (-0.17%) Total Size: 92.2 kB
ℹ️ View Unchanged
|
|
Playground | Link |
---|---|
React demo | https://livecodes.io?x=id/3XGSD3649 |
See documentations for usage instructions.
Let's revisit this when we plan v3. |
split from #2920
I thought it's nice to fix memory leak test, but it might not worth the breaking behavior.
We don't plan to merge this for now. We would like to collect more feedback on it, especially the failing test case not only in this repo, but also in the ecosystem. So, one of the purposes of this PR is to run jotai-ecosystem-ci to learn the effect of this breaking behavioral change.
Proposed Change In Behavior
Atom dependencies of async atoms are unmounted and remounted each time the async atom recomputes if they are accessed only after a delay. This will cause any atom.onMount and unmount functions to fire each time.
Example
Current
New