Hello there! Is there a way to short cut the follo...
# coroutines
u
Hello there! Is there a way to short cut the following code to one operator:
Copy code
override val view: Flow<WidgetView> = combine(
        expandedBranches, isWidgetCollapsed
    ) { paths, isWidgetCollapsed -> Pair(paths, isWidgetCollapsed)
    }.flatMapLatest { switchToNewFlow() based on Pair  }
I think that creating a pair is kind of redundant. But every time either of these two flows emits a new value, I need to switch to a different flow. Thanks!
combine’s transform function returns R, but I need Flow<R>
c
combineTransform
does return a Flow
Oh maybe I misread, you said “combine’s transform”, and I thought you said combineTransform
What do you mean by “switch to a new flow”?