b5dcc5eb8bd56d26e6d6e5413d79e6955f654cef0dde6fc4cc4bff347fa71e65.json 2.2 KB

1
  1. {"ast":null,"code":"import { from } from '../observable/from';\nimport { isArray } from '../util/isArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function onErrorResumeNext(...nextSources) {\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = nextSources[0];\n }\n return source => source.lift(new OnErrorResumeNextOperator(nextSources));\n}\nexport function onErrorResumeNextStatic(...nextSources) {\n let source = null;\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = nextSources[0];\n }\n source = nextSources.shift();\n return from(source, null).lift(new OnErrorResumeNextOperator(nextSources));\n}\nclass OnErrorResumeNextOperator {\n constructor(nextSources) {\n this.nextSources = nextSources;\n }\n call(subscriber, source) {\n return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));\n }\n}\nclass OnErrorResumeNextSubscriber extends OuterSubscriber {\n constructor(destination, nextSources) {\n super(destination);\n this.destination = destination;\n this.nextSources = nextSources;\n }\n notifyError(error, innerSub) {\n this.subscribeToNextSource();\n }\n notifyComplete(innerSub) {\n this.subscribeToNextSource();\n }\n _error(err) {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n _complete() {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n subscribeToNextSource() {\n const next = this.nextSources.shift();\n if (!!next) {\n const innerSubscriber = new InnerSubscriber(this, undefined, undefined);\n const destination = this.destination;\n destination.add(innerSubscriber);\n const innerSubscription = subscribeToResult(this, next, undefined, undefined, innerSubscriber);\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n } else {\n this.destination.complete();\n }\n }\n}\n//# sourceMappingURL=onErrorResumeNext.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}