combined flow will join two flows together. But, from what I could test, it only emits a message when both flows had emitted a value. How can I make sure to start receiving even when one of the flows had not emitted yet? This is my test, btw:
Copy code
fun main() = runBlocking {
val numbersFlow = flowOf(1,2,3).onEach { delay(1000) }
val lettersFlow = flowOf("A", "B","C").onEach { delay(2000) }
numbersFlow.combine(lettersFlow) { number, letter ->
"$number - $letter"
}.collect {
println(it)
}
}
// 1 - A
// 2 - A
// 3 - A
// 3 - B
// 3 - C