How do I map a `StateFlow` to another `StateFlow`?...
# coroutines
o
How do I map a
StateFlow
to another
StateFlow
?
stateFlow.map { } as StateFlow<T>
throws a ClassCastException
r
There is a example in the kDoc of how to combine 2 stateFlow
o
The combine is returning a Flow though, instead of a StateFlow
r
But wouldn't that be all you need?
that way you can collect from it
o
Not really, the mapped flow still represents a state
Of course you can still collect from it, but can't access the flow's value at any time
r
yea that would be the only thing missing. I see what you mean
o
595 Views