defaultIfEmpty method

Observable<T> defaultIfEmpty (T defaultValue)

Emit items from the source Stream, or a single default item if the source Stream emits nothing.

Example

new Observable.empty().defaultIfEmpty(10).listen(print); // prints 10

Implementation

Observable<T> defaultIfEmpty(T defaultValue) =>
    transform(DefaultIfEmptyStreamTransformer<T>(defaultValue));