Created
June 24, 2015 12:52
-
-
Save logcat/008d54a9557595e5c5e3 to your computer and use it in GitHub Desktop.
This file contains 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
public class Transformers { | |
public static <T> Observable.Transformer<Iterable<T>, T> flatten() { | |
return new Observable.Transformer<Iterable<T>, T>() { | |
@Override | |
public Observable<T> call(Observable<Iterable<T>> iterableObservable) { | |
return iterableObservable.flatMap(new Func1<Iterable<T>, Observable<T>>() { | |
@Override | |
public Observable<T> call(Iterable<T> iterable) { | |
return Observable.from(iterable); | |
} | |
}); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment