-
-
Save tseglevskiy/6fdc1de30c561115dd2b691e1333f4f2 to your computer and use it in GitHub Desktop.
Examples for article "RxJava - Hello World"
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<String> observable = Observable | |
.just("one", "two", "three"); | |
observable.subscribe(s -> System.out.println(s)); | |
Observable | |
.just("one", "two", "three") | |
.subscribe(s -> System.out.println(s)); | |
Observable | |
.just("one", "two", "three") | |
.map(s -> s.length()) | |
.subscribe(i -> System.out.println(i)); | |
Observable | |
.just("one", "two", "three") | |
.map(s -> s.length()) | |
.reduce(0, (a, b) -> a + b) | |
.subscribe(i -> System.out.println(i)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment