throwError.js 472 B

12345678
  1. import { Observable } from '../Observable';
  2. import { isFunction } from '../util/isFunction';
  3. export function throwError(errorOrErrorFactory, scheduler) {
  4. const errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory;
  5. const init = (subscriber) => subscriber.error(errorFactory());
  6. return new Observable(scheduler ? (subscriber) => scheduler.schedule(init, 0, subscriber) : init);
  7. }
  8. //# sourceMappingURL=throwError.js.map