-
-
Save jwkidd3/4242179e9f4d2e630deac3b2364bf9ae 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
Observable<Integer> values = Observable.create(o -> { | |
o.onNext(1); | |
o.onNext(1); | |
o.onNext(2); | |
o.onNext(3); | |
o.onNext(2); | |
o.onCompleted(); | |
}); | |
Subscription subscription = values | |
.distinct() | |
.subscribe( | |
v -> System.out.println(v), | |
e -> System.out.println("Error: " + e), | |
() -> System.out.println("Completed") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment