How can I pass values from a flow obtained inside ...
# announcements
j
How can I pass values from a flow obtained inside a function to a flow defined outside of it?
Copy code
val publicFlow: Flow<State> = flowOf(..)
fun doSomething() {
    launch {
        val localFlow = someService.getStream()
        // i want to expose values from localFlow through publicFlow here
    }
}
z
Check out
MutableSharedFlow
and
MutableStateFlow
👍 1
l
And next time, consider the #C1CFAFJSK channel 😉