Hey, I read this nice article : <https://medium.co...
# compose
n
Hey, I read this nice article : https://medium.com/androiddevelopers/migrating-from-livedata-to-kotlins-flow-379292f419fb but it made me realize I don't know how to do it in Compose. How does this integrate in a Compose world ?
I'm talking about things like repeatOnLifecycle for example
I think I found an example : https://kotlinlang.slack.com/archives/CJLTWPH7S/p1615397085281600?thread_ts=1615395535.277500&amp;cid=CJLTWPH7S so it can be combined with a LaunchedEffect... ok
❤️ 1
👍 2
m
how about the
WhileSubscribed
examples?
n
Not sure about which example, but WhileSubscribed should be used in a stateflow, from within a viewmodel, so I think that part shouldn't change much with Compose
✍️ 1
I'm still wondering if using
collectAsState()
should then be avoided (when the flow comes from a viewmodel, like a Room flow for example) in favor of
LaunchedEffect
... Annoying because collectAsState was a one-liner 😄