Is it ok to handle one-time events with a SharedFl...
# coroutines
a
Is it ok to handle one-time events with a SharedFlow instead of the LiveData + Event class approach?
a
the LiveData + Event class approach is a hacky workaround for not having a SharedFlow equivalent instead. Leave it behind and don't look back
☝️ 4
Can you clarify what you man by, "one time?"
a
ok great, just wanted to be sure here
Just the active subscriber receives the event
a
"the" as in, "only one subscriber receives" or, "only active subscribers, which may be 0 or many, will all receive the event?"
you can use
Channel.receiveAsFlow()
for the former and SharedFlow for the latter
a
ok thx man!
👍 2