jean
05/18/2020, 1:54 PMprivate val channel = Channel<Event>()
val events = flow { emit(channel.receive()) }
Use the channel inside a class to expose an api to emit values and receive those values else where as a flow?araqnid
05/18/2020, 1:58 PMchannel.consumeAsFlow()
?jean
05/18/2020, 1:58 PMaraqnid
05/18/2020, 1:59 PMAdam Powell
05/18/2020, 2:05 PMconsumeAsFlow
and receiveAsFlow
- the snippet that started this thread is the latter