When using `BroadcastChannel` in ViewModel in orde...
# coroutines
o
When using
BroadcastChannel
in ViewModel in order to send events, I was using the non suspend channel.offer(..) to send them, but now with SharedFlow, there seems only be the suspending
emit(...)
method. Does that mean all BroadcastChannel usage's can be migrated from
Copy code
events.offer(...)
to Sharedflow?
Copy code
viewModelScope.launch {
    events.emit(...)
}
If so, that looks like more boilerplate for simple events sending 😕
b
MutableSharedFlow has
tryEmit
, it's pretty the same as Channel's
offer
👍 3