Skip to content

Instantly share code, notes, and snippets.

@tseglevskiy
Created June 23, 2016 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tseglevskiy/6fdc1de30c561115dd2b691e1333f4f2 to your computer and use it in GitHub Desktop.
Save tseglevskiy/6fdc1de30c561115dd2b691e1333f4f2 to your computer and use it in GitHub Desktop.
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