https://kotlinlang.org logo
#coroutines
Title
# coroutines
d

Davide Giuseppe Farella

11/18/2020, 1:42 PM
Hello, is there an easy way to convert a
Flow
to a
StateFlow
on the fly? ( i.e.
flow.asStateFlow()
)
j

John O'Reilly

11/18/2020, 1:44 PM
stateIn
should work i believe
🙏 2
d

Davide Giuseppe Farella

11/18/2020, 1:45 PM
Is it Jvm only?
j

John O'Reilly

11/18/2020, 1:46 PM
no, shouldn't be
d

Davide Giuseppe Farella

11/18/2020, 1:47 PM
Tryin [1.3.9] -> [1.4.1]
Yep, it’s probably 1.4+, thank you 🙂
j

John O'Reilly

11/18/2020, 1:47 PM
Only issue might be if you're using
native-mt
version of kotlinx coroutines
that's only available for 1.3.9 right now
d

Davide Giuseppe Farella

11/18/2020, 1:48 PM
Not yet, I just got jvm + android as now
2 Views