Created
August 10, 2016 14:40
-
-
Save ragdroid/3db661f26dd431bc119e40c117fc7382 to your computer and use it in GitHub Desktop.
Rxify - Droidcon 2016 Example of using a zip() RxJava operator Raw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Preparing a polyjuice? Simple cast the spell - Zippyosa !! | |
Observable<PolyJuice> getPolyJuiceObservable() { | |
Observable<FluxWeed> ronObservable = getFluxWeedObservable(); | |
Observable<CrabHair> harryObservable = getHairObservable(); | |
return Observable.zip(ronObservable, harryObservable, new Func2<FluxWeed, CrabHair, PolyJuice>() { | |
@Override | |
public PolyJuice call(final FluxWeed fluxWeed, final CrabHair crabHair) { | |
return new PolyJuice(fluxWeed, crabHair) | |
.prepare(); | |
} | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment