https://kotlinlang.org logo
a

Andrey Kulikov

04/29/2020, 6:42 PM
Note that
Flow
integration should work fine with dev10 if you want to try it. unfortunately we didn't merge the adapter before the build cut, so it will be added in dev11. but feel free to temporary copy it from here and play with it
🎉 2
🙏🏼 8
s

Sinan Kozak

04/29/2020, 7:10 PM
Will we able to use flow directly or will we still need a Model object with annotation?
a

Andrey Kulikov

04/29/2020, 7:13 PM
the method will return you a State object. you don't need to create your class. you can take a look on a sample here https://android-review.googlesource.com/c/platform/frameworks/support/+/1287599/21/compose/compose-runtime/samples/src/main/java/androidx/compose/samples/FlowAdapterSamples.kt
f

flosch

04/29/2020, 8:08 PM
@Andrey Kulikov It might make sense to also provide a state flow extension in the future since it implicitly has an initial state
1
a

Andrey Kulikov

04/29/2020, 8:17 PM
sure, once we update to the coroutines version where it will be available
👍 1
s

Sinan Kozak

04/29/2020, 9:01 PM
Ohh sample is great. So we will be able to have our ui state on flow and convert to it Compose State. Sounds awesome 😄
3 Views