As we stated earlier, an Observable has three most important events/methods; let's discuss them one by one:
- onNext: Observable passes all items one by one to this method.
- onComplete: When all items have gone through the onNext method, Observable calls the onComplete method.
- onError: When Observable faces any error, it calls the onError method to deal with the error, if defined. Note that both onError and onComplete are terminal events, and if onError is called, then it would never call onComplete and vice versa.
Let's ...