Category Archives: Retrofit

Observable.zip()

public interface Api {   @GET("x") Observable<X> getX();   @GET("y") Observable<Y> getY();   } Observable.zip(api.getX(), api.getY(), new Func2<X, Y, Pair>() { @Override public Pair call(X x, Y y) { return new Pair(x, y); } }).subscribe(new Action1<Pair>() { @Override public void call(Pair pair) { // you got pair ;) } });

Also posted in Java, RxJava | Leave a comment