Last active
December 14, 2015 16:40
-
-
Save n8han/4497ce3c2fbd3830a36a to your computer and use it in GitHub Desktop.
When a source observable emits, skip any further emissions until a second observable completes
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 static <A, B> Observable<B> skipMap(Observable<A> source, Func1<A, Observable<B>> action) { | |
return source.first().flatMap(a -> Observable.concat(action.call(a), skipMap(source, action))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My use case is attaching a tap listener to an asynchronous task. Is there not an operator with these characteristics included in RxJava?