Kulwinder Singh
10/23/2019, 12:43 PMcombine
in flows like below
Firestore.getFlow1().combine(Firestore.getFlow2()) { f1, f2 -> Result(f1,f2)}
.combine(Firestore.getFlow3()) { f3, result -> result.f3 = f3 }
.collect { _liveData.value = it}
Here Firesstore.get*
all are wrappers that converts firestores snapshow listeners to flow, so here i have to listen three flows and want to combine them . is it good to do like this or there is any other way also ?louiscad
10/23/2019, 1:02 PMTriple
of the values from the three flows.Kulwinder Singh
10/23/2019, 1:17 PMKulwinder Singh
10/23/2019, 1:17 PMpg
10/23/2019, 2:50 PMlouiscad
10/23/2019, 3:29 PMcombine(flow1, flow2, flow3) { value1, value2, value3 -> Triple(value1, value2, value3) }