https://kotlinlang.org logo
Title
l

louiscad

05/13/2021, 12:07 PM
combine(liveData1.asFlow(), …)
k

Karan Sharma

05/13/2021, 12:15 PM
@louiscad This will not work.
🆗 1
r

Ryan Rolnicki

05/13/2021, 12:33 PM
Not super familiar with the android stuff, but it sounds like this might work: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/flatten-concat.html
👍 1
So something like
val myFlow = flowOf(flow1, flow2, flow3).flattenConcat()
k

Karan Sharma

05/13/2021, 1:10 PM
thanks ! @Ryan Rolnicki Let me try this !
m

myanmarking

05/14/2021, 8:17 AM
@louiscad solution is the right one for the problem you specified. You must be doing something wrong, it should work
r

Ryan Rolnicki

05/14/2021, 8:37 AM
Ah, yeah, looking at your question in more detail my answer isn't right; what I said will combine the flows such that when collected you will get each element individually, but it looks like you want to tie the results together, which is what combine does.