Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
typed Observable.zipN for input observables of same type
@SuppressWarnings("unchecked")
static <R, T> Observable<R> zip(Iterable<? extends Observable<T>> ws, Func1<List<T>, ? extends R> zipFunction) {
FuncN<R> funcN = (Object[] array) -> {
List<T> l = new ArrayList<T>();
for (Object o : array) {
l.add((T) o);
}
return zipFunction.call(l);
};
return Observable.zip(ws, funcN);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment