Skip to content

Instantly share code, notes, and snippets.

@tseglevskiy
Created June 23, 2016 20:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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