If the source Observable terminates without emitting any items, emits items from a backup Observable.
More...
If the source Observable terminates without emitting any items, emits items from a backup Observable.
- Template Parameters
-
BackupSource | the type of the backup observable. |
- Parameters
-
t | a backup observable that is used if the source observable is empty. |
- Returns
- Observable that emits items from a backup observable if the source observable is empty.
- Sample Code\n
values.subscribe(
[](int v) { printf("OnNext: %d\n", v); },
[]() { printf("OnCompleted\n"); } );
OnNext: 1
OnNext: 2
OnNext: 3
OnNext: 4
OnNext: 5
OnCompleted