Skip to content

Instantly share code, notes, and snippets.

@tseglevskiy tseglevskiy/MyClass.java Secret
Created Jun 23, 2016

Embed
What would you like to do?
Examples for article "RxJava - Hello World"
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
You can’t perform that action at this time.