https://kotlinlang.org logo
#android
Title
# android
h

Horv

07/30/2020, 10:18 PM
Found the issue, I was using LiveData-directly, instead of
observeAsState
f

flosch

07/31/2020, 5:31 AM
So you are using compose? Why are you not using the
Flow
directly with
collectAsState
but instead transform it to
LiveData
before exposing it?
j

Joost Klitsie

07/31/2020, 6:07 AM
There is also a thing as StateFlow now, which might suit your needs
f

flosch

07/31/2020, 6:08 AM
StateFlow
which also has a
collectAsState
extension for
compose
😄 1
j

Joost Klitsie

07/31/2020, 6:09 AM
I just woke up 😅
h

Horv

07/31/2020, 9:55 AM
Ah, very good point. I'll see to refactor it, thanks!