Custom Transformers and operators for Singles, Maybes, and Completables
There are Transformer and operator counterparts for Single
, Maybe
, and Completable
. When you want to create an Observable
or Flowable
operator that yields Single
, you might find it easier to convert it back into an Observable
/Flowable
by calling its toObservable()
or toFlowable()
operators. This also applies to Maybe
.
If on some rare occasion you need to create a Transformer or operator specifically to take a Single
and transform it into another Single
, you will want to use SingleTransformer
or SingleOperator
. Maybe
and Completable
will have counterparts with MaybeTransformer
/MaybeOperator
and CompletableTransformer
/CompletableOperator
, respectively. The implementation of apply()
for all of these should largely be the same experience, and you will use SingleObserver
, MaybeObserver
, and CompletableObserver
to proxy the upstream and downstream.
Here is an example of a SingleTransformer
that takes Single<Collection<...