Sometimes, you may require to listen only on the onComplete of a producer. The ignoreElements operator helps you to do that. Please refer to the following code:
fun main(args: Array<String>) { val observable = Observable.range(1,10) observable .ignoreElements() .subscribe { println("Completed") }//(1) }
The ignoreElements operator returns a Completable monad, which only has the onComplete event.
We will look into the skip and take operators in Chapter 6, More on Operators and Error Handling while discussing conditional operators.