I'm trying to create my own version of combine bec...
# coroutines
p
I'm trying to create my own version of combine because of https://github.com/Kotlin/kotlinx.coroutines/issues/1683 As the current combine implementation uses a lot of internal apis I can't just copy-past it. My code so far looks like this: https://gist.github.com/PaulWoitaschek/34225bfdea65e042431c6e57e72768f7 Can you review this and tells me if this a correct implementation?
a
It looks sane- you start emitting lists when you have at least one value from each flow, and the list always contains the latest value from each. You’re using a channelFlow, so that should be thread-safe. I suspect the joinAll() isn’t needed, the coroutineScope won’t finish until all the children jobs have finished.