deviant
02/18/2018, 8:07 PMval combineLatest = produce<Pair<String, String>>(coroutineContext) {
var item1 = channel1.receive()
var item2 = channel2.receive()
fun result() = item1 to item2
send(result())
while (isActive) {
send(select {
channel1.onReceive {
item1 = it
result()
}
channel2.onReceive {
item2 = it
result()
}
})
}
}