I hava a Maybe<> source and some kind of action that I want to perform with this value, if possibly not empty:
// Maybe<T> maybe(); // Completable action(T value); return maybe().flatMapCompletable(val -> action(val));
but when possibly empty, I want to complete "completed":
return Completable.complete();
How to make this switch: if maybe itβs not empty, get one terminated, otherwise another?
source share