Luis Munoz
03/06/2020, 10:02 PMbdawg.io
03/06/2020, 10:07 PMChannel<Array<T>>
and flatten it to Channel<T>
?Luis Munoz
03/06/2020, 10:10 PMDennis
03/06/2020, 10:11 PMfun <T> CoroutineScope.flatten(channel: ReceiveChannel<Array<T>>): ReceiveChannel<T> = produce {
for (items in channel) {
for(item in items) send(item)
}
}
However there could be something already that i don't know...Luis Munoz
03/06/2020, 10:13 PMbdawg.io
03/06/2020, 10:16 PMFlow
val myChannel = channel
.consumeAsFlow()
.flatMapConcat { it.asFlow() }
.filter { ... }
.map { ... }
.produceIn(myScope)
Dennis
03/06/2020, 10:18 PMflow