andylamax
07/08/2020, 4:16 AM(Mutable)StateFlow<T>
to another (Mutable)StateFlow<T>
? when I call the map
method I map the StateFlow<T>
to a Flow<T>
Tim Malseed
07/08/2020, 4:19 AMMutableStateFlow
, you’ve just lost the type inference. You could cast your resulting Flow<T>
as a MutableStateFlow<>
Zach Klippenstein (he/him) [MOD]
07/08/2020, 4:25 AMmap
does not return a StateFlow
, it returns a regular Flow
. You'd need to use something like stateIn
to convert it back.Tim Malseed
07/08/2020, 4:27 AMMutableStateFlow
. But I guess that doesn’t make sense, since the Flow’s value type has changed (it emits a different type to the one it receives)andylamax
07/08/2020, 5:00 AMZach Klippenstein (he/him) [MOD]
07/08/2020, 1:48 PMStateFlow
type on its own is explained by Roman in the comments here: https://github.com/Kotlin/kotlinx.coroutines/issues/2081