February 2020
Intermediate to advanced
412 pages
9h 36m
English
The skip() operator does the opposite of the take() operator. It ignores the specified number of emissions and then emits the ones that follow. Let's skip the first 90 emissions in the following code snippet:
import io.reactivex.rxjava3.core.Observable;public class Ch3_08 { 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 as in the case of the take() operator, there is also an overloaded version that accepts a time duration.
And there is a skipLast() operator, which skips ...
Read now
Unlock full access