https://kotlinlang.org logo
#coroutines
Title
# coroutines
g

groostav

10/07/2019, 9:39 PM
is there a factory to fan-in two
Flow<T>
instances into a single
Flow<T>
d

Dominaezzz

10/07/2019, 9:40 PM
There's
zip
and
combine
.
g

groostav

10/07/2019, 9:41 PM
combine
is not what im looking for, I'm not looking to make two
Flow<T>
into a
Flow<R>
by matching events, I'm looking to multiplex the two events
with channels I'd use
produce
with a
select
statement. I think the same is true here.
o

octylFractal

10/07/2019, 9:42 PM
make a
flowOf(a, b)
and
flatMapCombine
?
or rather, if you need to multiplex,
flatMapMerge
🤔 1
oop, those are for doing flat map as well. but it's the right direction, the one you really want is in the docs of that one:
flattenMerge
s

Seri

10/07/2019, 9:46 PM
u

ursus

10/07/2019, 10:20 PM
like rx
merge
?
g

groostav

10/10/2019, 9:20 PM
@Seri thanks for this, I did end up with
flattenMerge
though progress with it has been tough
s

Seri

10/10/2019, 9:23 PM
👍
g

groostav

10/10/2019, 9:27 PM
note to self: there is a big difference between
flow.map { it.also { "INFO: $it" }}
and
flow.map { it.also { println("INFO: $it") } }
. 🤦‍♂️
3 Views