Hi everyone, hope you are all doing well :wave: Is...
# compose-ios
d
Hi everyone, hope you are all doing well 👋 Is there some workaround to
collectAsStateWithLifecycle
in iOS? I know I can use `expect`/`actual` to use
collectAsState
in iOS and
collectAsStateWithLifecycle
in Android but I was wondering if there is some manual workaround to have collectAsStateWithLifecycle on iOS or it just works differently on that platform?
a
I think it depends on what you are using for lifecycle in KMP. If you are using Decompose/Essenty Lifecycle, maybe
Flow.withLifecycle
will work for you?
thank you color 1
l
androidx.lifecycle is now multiplatform (since last week), but I'm not sure if
collectAsStateWithLifecycle
already is since it's very recent.
thank you color 1
d
Thank you guys, I will wait for it to be ready then. Wont overcomplicate things since app is still in its early phase
c
@Djuro you can take a look at
PreCompose
library here are some specs: • Navigation • ViewModel • Lifecycle handler including
collectAsStateWithLifecycle
.
d
Thank you Carlos but I will stick to decompose since I think it is much better
✅ 1
decompose intensifies 1