Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to merge two data sources with rxJava.
restObservable = giphyService.searchGiphy(getGiphyQueryMap("dog")).flatMap(new Func1<GiphySearch, Observable<GiphyGif>>() {
public Observable<GiphyGif> call(GiphySearch giphySearch) {
return Observable.from(;
}).zipWith(namesService.getPeople().flatMap(new Func1<List<People>, Observable<Person>>() {
public Observable<Person> call(List<People> people) {
return Observable.from(people);
}), new Func2<GiphyGif, Person, GifAndData>() {
public GifAndData call(GiphyGif giphyGif, Person person) {
return new GifAndData(giphyGif.url,;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.