-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: earlier onBecome(Un)Observed disposer will not dispose later listener (fix #1537) #1833
Conversation
I see two problems on this code:
|
@mayorovp Thanks for replying.
|
User can give any name to atoms manually. |
|
Oh.. It's a fatal mistake I did not realize. Thanks, I' ll try to resolve it. |
This pr has been rewrote. Welcome review. |
Thanks for reviewing. The pr has updated, there's still an |
Thanks @fi3ework ! |
Thanks for taking the effort to create a PR!
If you are creating an extensive PR, you might want to open an issue with your idea first, so that you don't put a lot of effort in an PR that wouldn't be accepted. Please prepend pull requests with
WIP:
if they are not yet finishedPR checklist:
gh-pages
branch. Please refer to this PR). For new functionality, at least API.md should be updatednpm run perf
)This PR is to fix #1537, in
become-observed.ts
, there is a shared object to store theonBecomeObserved
andonBecomeUnobserved
for each Atom instance by name. Each Set of the hook of an atom will be initialized only whenonBecomeUnobserved
oronBecomeUnobserved
invoked. So I think there's no harm to the performance.Looking forward to your opinion 😆
Special thanks to #1771