Created
March 31, 2022 17:38
-
-
Save rubykv/648e93e3512e0c0f8758ee1471b7d72e 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> observable1 = Observable.just(1, 2, 3, 4, 5); | |
Consumer<Integer> addValues = (x) -> System.out.println("Adding " + x + " ::" + (x + 2)); | |
Consumer<Integer> subValues = (x) -> System.out.println("Subtracting " + x + " :: " + (x - 1)); | |
observable1.filter(x -> x > 1).subscribe(x -> addValues.accept(x)); | |
observable1.filter(x -> x < 2).subscribe(x -> subValues.accept(x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment