Skip to content

Conversation

@ra1028
Copy link
Owner

@ra1028 ra1028 commented Apr 19, 2024

Pull Request Type

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

Description

There is an existing problem that when a selector atom that has ObservableObjectAtom as a dependency is being watched from a view, a view animation is not applied when the ObservableObject's properties are updated.
This is because when objectWillChange emits the event, it delays updating the view until the next execution of the run loop so that atoms can handle the changed values.
For the ObservableObjectAtom being watched directly from the view, we had included a workaround so that the animation was valid, but it was not possible for the cases via another selector atom.

To make a little more stable countermeasure for this problem, this PR removes the internal workaround for enabling animation of ObservableObjectAtom in any case, in other words, it makes it completely not animateable by default, and instead implements .animation(_:) modifier that allows arbitrary animation to be given to updates.

Impact on Existing Code

  • ObservableObjectAtom no longer animates the view when updated.

@ra1028 ra1028 force-pushed the feat/animation-modifier branch 2 times, most recently from ac9901e to 885c9ea Compare April 22, 2024 05:13
@ra1028 ra1028 force-pushed the feat/animation-modifier branch from 885c9ea to 88411e7 Compare April 22, 2024 06:48
@ra1028 ra1028 marked this pull request as ready for review April 22, 2024 08:35
@ra1028 ra1028 merged commit 2e93b28 into main Apr 22, 2024
@ra1028 ra1028 deleted the feat/animation-modifier branch April 22, 2024 08:36
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.

2 participants