Flow.merge() with different value types

Is there a function to combine two Flows with different value types into a single flow without dropping the knowledge about the triggering flow. If I would use combine(flowA: Flow<A>, flowB Flow<B>, transform: (A, B) -> Result) then I lose the information about the triggering flow in transform() because a cached value of A or B will be passed. Right now, I do a conversion from Flow<A> to Flow<Result> and a conversion from Flow<B> to Flow<Result> and after that I merge both result flows: merge(flowResultA, flowResultB).
And one last question, why is there a Flow.combine() extension function but no Flow.merge() extension function :slight_smile: ?

I may not fully understand your case, but I think the conversion to Result and then merge() is the proper way to do this.

combine() is for cases when we need to process the most recent values for all flows, we usually don’t care which one has been updated. For example, we have two flows of ints and we need a flow of sums of these ints

If you want to convert both A and B into a common type and merge them into a single flow, then… well, I just described what you actually did :slight_smile: