February 2020
Intermediate to advanced
412 pages
9h 36m
English
The onNext(), onComplete(), and onError() methods actually compose the Observer type – an interface implemented throughout RxJava to communicate the corresponding events. The following is the Observer interface definition (do not concern yourself with onSubscribe() for now, as we will cover it at the end of this chapter):
import io.reactivex.rxjava3.disposables.Disposable;public interface Observer<T> { void onSubscribe@NonNull Disposable d); void onNext(@NonNull T value); void onError(Throwable e); void onComplete();}
An Observer and source Observable are somewhat related. In one context, a source Observable is where emissions originate and the processing chain starts. In our previous examples, you could say that the ...
Read now
Unlock full access