Skip to content

Conversation

@ra1028
Copy link
Owner

@ra1028 ra1028 commented Sep 2, 2022

Pull Request Type

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

Issue for this PR

close #18

Description

All atoms can now implement updated(newValue:oldValue:reader: method to declaratively manage side-effects when its value is updated.
The method can use other atoms but doesn't allow initiating to watch another atom for safety.
This API overwraps the usage of StateAtom/willSet-didSet, so they are now abolished, and it also solves a problem described in #18.

Impact on Existing Code

These existing APIs have been abolished.

  • StateAtom/willSet(newValue:oldValue:context: Context)
  • StateAtom/didSet(newValue:oldValue:context: Context)

@ra1028 ra1028 merged commit 394168f into main Sep 2, 2022
@ra1028 ra1028 deleted the feat/update-state-atom branch September 2, 2022 15:32
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.

[Bug]: Do not pass AtomTransactionContext to StateAtom.willSet/didSet

2 participants