The following are some helpful operators that can assist in debugging as well as getting visibility into an Observable chain. These are the action or doOn operators. They do not modify the Observable, but use it for side effects.
Action operators
doOnNext() and doAfterNext()
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...