I have a List<Observable<T>>
that I would like to transform into an Observable<List<T>>
.
I am aware of Observable.zip
, which seems like the right function, but I'm not sure how to define the zipper
parameter.
Here is what I have tried:
final List<Observable<T>> tasks = getTasks();
final Observable<List<T>> task = Observable.zip(
tasks,
x -> ImmutableList.copyOf(x)
.stream()
.map(x -> (T)x)
.collect(ImmutableList.toImmutableList()));
However, this requires an unchecked cast.
How should I go about this in RxJava 2?
Note that this question refers to RxJava 1.
>` then I can read the progress of each download over time.
– sdgfsdh May 24 '17 at 20:56