...

/

Reactive Everything: Completable, Single, and Maybe

Reactive Everything: Completable, Single, and Maybe

Learn about the alternative base reactive types of RxJava.

So far, the Observable class has been our focus for enabling reactive programming with RxJava. However, RxJava also offers the following alternative base reactive types.

Single

In our previous example in Leaving the Reactive World, we looked at another base reactive type called a Single. As mentioned earlier, a Single is a special type of Observable that only emits a single item rather than a stream of items.

Consequently, an observer to a Single, a SingleObserver, has a different signature and only receives the following events:

  • The .onSubscribe() function is invoked on subscription and a ...