Files
cssd-back/node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js
T
2019-07-15 13:07:31 +04:30

15 lines
416 B
JavaScript
Vendored

import { tap } from './tap';
import { EmptyError } from '../util/EmptyError';
export const throwIfEmpty = (errorFactory = defaultErrorFactory) => tap({
hasValue: false,
next() { this.hasValue = true; },
complete() {
if (!this.hasValue) {
throw errorFactory();
}
}
});
function defaultErrorFactory() {
return new EmptyError();
}
//# sourceMappingURL=throwIfEmpty.js.map