I have Flow1 returns data that Flow2 needs, if Flow1 fails then I want Flow2 to basically rewrap that error and emit it.
If Flow1 is successful I want Flow2 to return a room DB Flow.
flow1.combine(flow2), but obviously there is no way to pass the value from flow1 to flow2
I tried
flow1.map{x
flow2Fun(x)
}
where flow2Fun returns a Flow<A>, but the map gives a result of Flow<Flow<A>>.
What is the best way to do this, since flow1 can change during life of app