hugoWebsite/node_modules/rxjs/dist/esm/internal/observable/throwError.js

8 lines
472 B
JavaScript
Raw Normal View History

2022-10-29 00:20:35 +02:00
import { Observable } from '../Observable';
import { isFunction } from '../util/isFunction';
export function throwError(errorOrErrorFactory, scheduler) {
const errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory;
const init = (subscriber) => subscriber.error(errorFactory());
return new Observable(scheduler ? (subscriber) => scheduler.schedule(init, 0, subscriber) : init);
}
//# sourceMappingURL=throwError.js.map