This may be a stupid question, but is there a conc...
# flow
l
This may be a stupid question, but is there a concise way to convert a List<Flow<T>> to a Flow<List<T>> that emits a value when any flow in the list emits a value?
r
combine
?
l
I didn’t notice that combine has the ability to take a list 🤦
d
what do you want the resulting List<T> to contain ? I just worked out a similar question, the request was to have the resulting List<> be the concatenation of all prior elements. For that, scan() worked . If your case is similar then something like this, using merge+ scan val input = listOf( flow.....) input.merge().scan( emptyList() ){ a,b -> a + b }
Thata should produce a flow containing the successively longer list each time any of the input values are emitted