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

Scoped Observe #109

Merged
merged 2 commits into from
Apr 17, 2024
Merged

Scoped Observe #109

merged 2 commits into from
Apr 17, 2024

Conversation

ra1028
Copy link
Owner

@ra1028 ra1028 commented Apr 17, 2024

Pull Request Type

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

Description

AtomScope.observe(_:) has been working implicitly as scoped observation which receives state changes of atoms used in the scope, so this PR is to make it explicit along with renaming the function name to scopedObserve(_:).
Lthough it was originally a scoped observation, it has been receiving state changes triggered by nested scopes as well but it's no longer be received by this PR.
To receive whole app state changes, use AtomRoot.observe(_:) instead. Also, to rceive state changes triggered by nested multiple scopes, use AtomScope.init(inheriting:) to inherit obsevers from ancestor scopes.

Impact on Existing Code

  • AtomScope.observe(_:) is deprecated and renamed to AtomScope.scopedObserve(_:).

@ra1028 ra1028 merged commit 10f4e42 into main Apr 17, 2024
6 checks passed
@ra1028 ra1028 deleted the feat/scoped-observe branch April 17, 2024 12:43
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