Open mainrs opened 7 months ago
Google and Jetbrains are working on Lifecycle multiplatform, there are already merged changes for that, I assume it will be available until the final 1.6.0 release for Compose KMP. As for now, we need to wait or use a third party solution.
When this API be available in Compose rc
versions, we should update Voyager to support it here.
https://developer.android.com/jetpack/androidx/releases/lifecycle#2.8.0-alpha02 https://github.com/JetBrains/compose-multiplatform-core/pull/1043
Is this why collectAsStateWithLifecycle
is crash (cant find lifeycleOwner) even when being run on Android device?
When this API be available in Compose
rc
versions, we should update Voyager to support it here.
It is now in RC: https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.6.10-rc01
I want to prevent flow collection on recomposition. Currently, I am using this code:
However, this adds the collector again once recomposition happens due to lifecycle changes like PAUSE or RESUME on Android. How can I tackle this problem properly using Voyager? There only seems to be the possibility to listen for onStarted and onDisposed events and nothing more using
LifecycleEffect
. Is there a reason why the other events are missing?