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!
ubu
03/01/2023, 11:44 AM
combine’s transform function returns R, but I need Flow<R>
c
Chris Fillmore
03/01/2023, 12:19 PM
combineTransform
does return a Flow
Chris Fillmore
03/01/2023, 12:20 PM
Oh maybe I misread, you said “combine’s transform”, and I thought you said combineTransform