whats the best way to call `onEach` on a `StateFlo...
# coroutines
x
whats the best way to call
onEach
on a
StateFlow<*>
and still retain a
StateFlow<*>
as the return type?
c
See this thread for some solutions. Basically, you need to use
.stateIn()
after the operator chain to convert the Flow back into a StateFlow, which requires a separate CoroutineContext to run the “mapping” function in