Is there something analogous to observable.create ...
# coroutines
a
Is there something analogous to observable.create for Coroutines I found a way through channels just want to dug upon any different ways?
g
For which abstraction? Flow?
z
The closest analog is
flow { }
and
channelFlow { }
, which create cold `Flow`s. For channels, there’s
CoroutineScope.produce { }
(although channels are hot, so that’s a bit different than
Observable.create
).
Use
flow
if you’re emitting from a single context, use
channelFlow
if you need to emit from other coroutines, or from a regular callback.
a
Hey @Zach Klippenstein (he/him) [MOD] thanks will look into this 🙂