June 2017
Intermediate to advanced
400 pages
8h 44m
English
The skip() operator does the opposite of the take() operator. It will ignore the specified number of emissions and then emit the ones that follow. If I wanted to skip the first 90 emissions of an Observable, I could use this operator, as shown in the following code snippet:
import io.reactivex.Observable;public class Launcher { public static void main(String[] args) { Observable.range(1,100) .skip(90) .subscribe(i -> System.out.println("RECEIVED: " + i)); }}
The output of the following code snippet is as follows:
RECEIVED: 91RECEIVED: 92RECEIVED: 93RECEIVED: 94RECEIVED: 95RECEIVED: 96RECEIVED: 97RECEIVED: 98RECEIVED: 99RECEIVED: 100
Just like the take() operator, there is also an overload accepting a time duration. There is also a ...
Read now
Unlock full access