February 2020
Intermediate to advanced
412 pages
9h 36m
English
The three operators, doOnNext(), doOnComplete(), and doOnError(), are like putting a mini Observer right in the middle of the Observable chain.
The doOnNext() operator allows a peek at each received value before letting it flow into the next operator. The doOnNext() operator does not affect the processing or transform the emission in any way. We can use it just to create a side effect for each received value. For instance, we can perform an action with each String object before it is mapped to its length. In this case, we just print them by providing a Consumer<T> function as a lambda expression:
import io.reactivex.rxjava3.core.Observable;public class Ch3_50 { public static void main(String[] args) { Observable. ...
Read now
Unlock full access