UNPKG

recoder-code

Version:

🚀 AI-powered development platform - Chat with 32+ models, build projects, automate workflows. Free models included!

8 lines • 522 B
import { Observable } from '../Observable'; import { isFunction } from '../util/isFunction'; export function throwError(errorOrErrorFactory, scheduler) { var errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : function () { return errorOrErrorFactory; }; var init = function (subscriber) { return subscriber.error(errorFactory()); }; return new Observable(scheduler ? function (subscriber) { return scheduler.schedule(init, 0, subscriber); } : init); } //# sourceMappingURL=throwError.js.map