Files
book-test/node_modules/rxjs/dist/esm5/internal/operators/defaultIfEmpty.js
T
chris a7524412f0
CI/CD Pipeline / test (push) Failing after 2m38s
CI/CD Pipeline / deploy-internal (push) Has been skipped
Add web front-end and fix API issues
2026-08-28 21:47:05 -04:00

17 lines
594 B
JavaScript

import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function defaultIfEmpty(defaultValue) {
return operate(function (source, subscriber) {
var hasValue = false;
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
hasValue = true;
subscriber.next(value);
}, function () {
if (!hasValue) {
subscriber.next(defaultValue);
}
subscriber.complete();
}));
});
}
//# sourceMappingURL=defaultIfEmpty.js.map