Class DefaultIfEmptyOperator
Implements the DefaultIfEmpty operator. Mirrors rxjs's defaultIfEmpty.
public static class DefaultIfEmptyOperator
- Inheritance
-
System.ObjectDefaultIfEmptyOperator
Methods
DefaultIfEmpty<T>(Observable<T>, T)
Mirrors source, but if it completes without ever emitting a value, emits
defaultValue first.
public static Observable<T> DefaultIfEmpty<T>(this Observable<T> source, T defaultValue)
Parameters
sourceObservable<T>The source observable to monitor for emptiness.
defaultValueTThe value to emit if
sourcecompletes without emitting anything.
Returns
- Observable<T>
An observable that mirrors
source, substitutingdefaultValuewhen it would otherwise complete empty.
Type Parameters
TThe element type of the source observable and the default value.