Skip to content
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: Ensure that ObservableObjectAtom notifies updates after a new @Published value is set #10

Merged
merged 2 commits into from
Aug 7, 2022

Conversation

ra1028
Copy link
Owner

@ra1028 ra1028 commented Aug 1, 2022

Pull Request Type

  • Bug fix
  • New feature
  • Refactoring
  • Documentation update
  • Chore

Issue for this PR

Link: #9

Description

ObservableObjectAtom doesn't update other atoms that depend on it correctly.
The root cause was the downstream atoms observes the update by subscribing to objectWillChange publisher, but it notifies update at willSet property observer, so the property is yet to be updated.

Motivation and Context

#9

Impact on Existing Code

Added an overload function of AtomRelationContext/watch for ObservableObject. It wouldn't be a critical syntax change but there's a difference on compilation.

… the new value of the observable object's property is actually set
@ra1028 ra1028 marked this pull request as ready for review August 7, 2022 01:24
@ra1028 ra1028 merged commit e8ce984 into main Aug 7, 2022
@ra1028 ra1028 deleted the feat/observable-object-did-update branch August 7, 2022 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant