elizarov
04/29/2020, 5:36 PMStateFlow
is documented in a new issue. Your feedback is welcome: https://github.com/Kotlin/kotlinx.coroutines/issues/1973Colton Idle
04/29/2020, 7:05 PMDominaezzz
04/29/2020, 7:18 PMFlow
.Casey Brooks
04/29/2020, 7:24 PMigor.wojda
04/29/2020, 7:27 PMDominaezzz
04/29/2020, 7:29 PMstateIn(lifecycleScope)
is the best we get I think.Casey Brooks
04/29/2020, 7:30 PMbezrukov
04/29/2020, 7:48 PMlifecycleScope
extension in androidx
and this scope has launchWhenXXX (XXX - is lifecycle state: created/started/resumed) funs. Block inside launch will be resumed after it's suspended only if it's in correct state
So
lifecycleOwner.lifecycleScope.launchWhenStarted {
flow.collect {
// todo
}
}
is lifecycle awareColton Idle
04/29/2020, 8:00 PMvoben
04/29/2020, 8:04 PMkenkyee
04/30/2020, 1:15 AMdimsuz
04/30/2020, 9:38 AMpakoito
04/30/2020, 9:44 AMdimsuz
04/30/2020, 9:51 AM