val someStateFlow = flow1.combine(flow2) { a, b ->
recievingFlowFromRepository()
}.stateIn(...)
Vivek Sharma
02/09/2021, 2:32 PM
I have code like this ,so this returns
Flow<Flow<>>
because combine returns by making a flow inside a lambda
o
okarm
02/09/2021, 2:38 PM
Yes
Copy code
paramFlow1.combine(paramFlow2) { a, b ->
Pair(a, b)
}.flatMapLatest { (a, b) -> // destructured Pair
loadWithParameters(a, b) // this returns a Flow
}.stateIn(...)