Hi :android-wave: , I am combining and collecting ...
# coroutines
a
Hi 👋 , I am combining and collecting some flows in my ViewModel. Is there any way to know which flow triggered the collect method? Note: This is only for debugging purposes. So, any AS debugging feature (or even printing in a single place) is fine.
Copy code
return combine(flow, flow2, flow3, flow4) { value1, value2, value3, value4 ->
        Quadruple(value1, value2, value3, value4)
}.collectLatest {
        // How to know which flow changed?
}
k
Copy code
return combine(
  flow.onEach { println(it) },
  flow2.onEach { println(it) },
  flow3.onEach { println(it) },
  flow4.onEach { println(it) }
) { value1, value2, value3, value4 ->
        Quadruple(value1, value2, value3, value4)
}.collectLatest {
        // How to know which flow changed?
}
a
Thank You thank you color . This serves my purpose.