Tutorial by Examples

An operator can be used to manipulate the flow of objects from Observable to Subscriber. Observable<Integer> integerObservable = Observable.just(1, 2, 3); // creating a simple Integer observable Subscriber<String> mSubscriber = new Subscriber<String>() { @Override publi...
The flatMap operator help you to transform one event to another Observable (or transform an event to zero, one, or more events). It's a perfect operator when you want to call another method which return an Observable public Observable<String> perform(int i) { // ... } Observabl...
You can use the filter operator to filter out items from the values stream based on a result of a predicate method. In other words, the items passing from the Observer to the Subscriber will be discarded based on the Function you pass filter, if the function returns false for a certain value, that ...
You can use the map operator to map the values of a stream to different values based on the outcome for each value from the function passed to map. The outcome stream is a new copy and will not modify the provided stream of values, the result stream will have the same length of the input stream but ...
doOnNext operator called every time when source Observable emits an item. It can be used for debugging purposes, applying some action to the emitted item, logging, etc... Observable.range(1, 3) .doOnNext(value -> System.out.println("before transform: " + value)) .map(value -&...
repeat operator allow to repeat whole sequence from source Observable. Observable.just(1, 2, 3) .repeat() .subscribe( next -> System.out.println("next: " + next), error -> System.out.println("error: " + error), () -> System.out.print...

Page 1 of 1