-
-
Notifications
You must be signed in to change notification settings - Fork 17
Fix issue where scoped overrides/observers are not reflected #167
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
Conversation
2469a08 to
90b988f
Compare
shingt
left a comment
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.
Performed some testing on the app, too / LGTM. Thank you!!
| private let rootScopeKey: ScopeKey | ||
| private let currentScopeKey: ScopeKey? |
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.
Makes sense
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.
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
Pull Request Type
Description
Expected overrides and observers are not reflected when atoms are updated across the scope boundary.
For example, let's say you have AtomA, which depends on AtomB and AtomC. AtomB is scoped due to override, AtomC is shared. Now, AtomC gets updated, and it also updated the downstream - AtomA. AtomA accesses AtomB to calculate its new value, but it fails to get the overridden value because it's updated from the scope of AtomC, which is not intuitive. In terms of API ergonomics, the AtomA should definitely be updated with the scope in which the AtomA was initialized.