https://kotlinlang.org logo
Title
o

Orhan Tozan

10/27/2020, 8:57 AM
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
events.offer(...)
to Sharedflow?
viewModelScope.launch {
    events.emit(...)
}
If so, that looks like more boilerplate for simple events sending 😕
b

bezrukov

10/27/2020, 9:00 AM
MutableSharedFlow has
tryEmit
, it's pretty the same as Channel's
offer
👍 3