I want to combine multiple flows by `combine` func...
# coroutines
a
I want to combine multiple flows by
combine
function in variable x as following:
Copy code
val x = combine(flow1, flow2) { (flow1, flow2) ->
    listOf(flow1, flow2)
}
when I call collect on x flow the result will be empty because flow1 and flow2 not ready yet, so I want to trigger collect on each flow gets ready to get latest data always.
d
What do you mean by not ready yet?
a
flow1 and flow2 are data from API which take some time to get ready.
d
So? If it takes a while then the flow while suspend for a while.
☝️ 2
s
flow1.onStart { emit(defaultValue) }
And the same for flow2
n
Isn't it normal that flows would take time to emit values? The consumer will wait then.