Replies: 3 comments
-
I am experiencing the same issue |
Beta Was this translation helpful? Give feedback.
-
Hi @heoblitz, this is happening because effect actions that emit actions immediately (such as is the case with Note that this doesn't have anything to do with return .publisher {
Just(.changeShowingDetailView)
.delay(for: 0, scheduler: DispatchQueue.main)
}
.animation(.default) …it will also work. I'm not really sure there is anything the library can do to change this behavior. Our choice to process synchronous actions in the same call stack as when the original action was sent is due to people relying and expecting that kind of behavior. Breaking that expectation will lead to a lot of problems. I'm inclined to convert this to a discussion since I don't think the library can really do anything to remedy this, and there are simple workarounds. How does that sound? |
Beta Was this translation helpful? Give feedback.
-
@mbrandonw Thanks for the clarification. It's a minor comment, but it would be nice to have the publisher animation usage in the documentation or comments. As you say, it would be great to close the issue and turn it into a discussion! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In certain cases, the publisher animation is not working, but using run animation solves the problem.
Looking at the logs, it seems that transactions are not being updated correctly when using publisher animations.
If you modify your current animation structure to fire "withTransaction" when you assign a value to a store state, publisher animations will work fine.
Checklist
main
branch of this package.Expected behavior
Transaction is updated correctly and the animation works.
Actual behavior
Transaction doesn't update and the animation doesn't work.
Steps to reproduce
branch: https://github.com/heoblitz/swift-composable-architecture/tree/issue/animation
file: swift-composable-architecture.zip
Download the project file and build it with the "AnimationTest Scheme."
Proceed with testing while changing the effect return values.
1. publisher animation
RPReplay_Final1698111785.MP4
2. run animation
RPReplay_Final1698111825.MP4
The Composable Architecture version information
c472ea4
Destination operating system
iOS 17.0.3, iOS 15.1
Xcode version information
Version 15.0 (15A240d)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions