Thomas04/21/2019, 4:55 PM
louiscad04/21/2019, 4:56 PM
simon.vergauwen04/21/2019, 5:00 PM
Note that FlatMap merges the emissions of these Observables, so that they may interleave.These docs makes comparison with other operators. http://reactivex.io/documentation/operators/flatmap.html
look like good examples.
Thomas04/21/2019, 6:25 PM
doesn’t exist in Flow. Do you mean
instead? Which one would be the equivalent of
simon.vergauwen04/21/2019, 6:28 PM
and seeing how it’s an alias to
I imagine this behaves as
flatMapMerge(concurrency = 1, bufferSize = 1)
but the docs are not extensive enough to confirm that without trying it out unfortunately.
Transforms elements emitted by the original flow by applying transform, that returns another flow, and then concatenating and flattening these flows. This method is identical to flatMapMerge(concurrency = 1, bufferSize = 1)source: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/
Thomas04/21/2019, 6:30 PM
still needs to be added: https://github.com/Kotlin/kotlinx.coroutines/issues/1107 So I think
works a bit differently but I really don’t know without trying.
streetsofboston04/21/2019, 11:44 PM
Thomas04/22/2019, 9:03 AM
streetsofboston04/22/2019, 12:03 PM
inside a `launch`ed coroutine. Then cancelling the
returned by that
looks more idiomatic to me. Still, I think we'd want a more simple way, more imperative/sequential way of breaking out of a
loop. You can't break out of an Rx
either, but since coroutines allow for a more imperitive/sequential way of programming, it would be great if Coroutines'
would allow a 'break' or 'exit' out of the loop. Think about having two plain `Collection<T>`s and writing a
for these two collections just using
Thomas04/22/2019, 7:13 PM
, just like you explained earlier.