switchIfEmpty

fun <T> Maybe<T>.switchIfEmpty(other: Maybe<T>): Maybe<T>

Returns a Maybe that first subscribes to this Maybe and signals its events, unless this Maybe signals onComplete. If this Maybe signals onComplete, then subscribes to the other and signals its events.

Please refer to the corresponding RxJava document.


fun <T> Maybe<T>.switchIfEmpty(other: Single<T>): Single<T>

Returns a Maybe that first subscribes to this Maybe and signals its events, unless this Maybe signals onComplete. If this Maybe signals onComplete, then subscribes to the other and signals its events.

Please refer to the corresponding RxJava document.