https://kotlinlang.org logo
#flow
Title
# flow
s

Simon Lin

09/29/2021, 3:59 AM
How can I use
CoroutineExceptionHandler
in flow? for example
Copy code
val flow = flow { emit("data") }
    .shareIn(viewModelScope, SharingStarted.WhileSubscribed(), 1)
b

baxter

09/30/2021, 2:02 AM
Use
catch
on the flow. The
CoroutineExceptionHandler
is a context that is passed to a coroutine.
👀 1
3 Views