You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.0 KiB
1 lines
2.0 KiB
{"ast":null,"code":"import { from } from '../observable/from';\nimport { isArray } from '../util/isArray';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\nexport function onErrorResumeNext(...nextSources) {\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = nextSources[0];\n }\n\n return source => source.lift(new OnErrorResumeNextOperator(nextSources));\n}\nexport function onErrorResumeNextStatic(...nextSources) {\n let source = undefined;\n\n if (nextSources.length === 1 && isArray(nextSources[0])) {\n nextSources = nextSources[0];\n }\n\n source = nextSources.shift();\n return from(source).lift(new OnErrorResumeNextOperator(nextSources));\n}\n\nclass OnErrorResumeNextOperator {\n constructor(nextSources) {\n this.nextSources = nextSources;\n }\n\n call(subscriber, source) {\n return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));\n }\n\n}\n\nclass OnErrorResumeNextSubscriber extends SimpleOuterSubscriber {\n constructor(destination, nextSources) {\n super(destination);\n this.destination = destination;\n this.nextSources = nextSources;\n }\n\n notifyError() {\n this.subscribeToNextSource();\n }\n\n notifyComplete() {\n this.subscribeToNextSource();\n }\n\n _error(err) {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n\n _complete() {\n this.subscribeToNextSource();\n this.unsubscribe();\n }\n\n subscribeToNextSource() {\n const next = this.nextSources.shift();\n\n if (!!next) {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(next, innerSubscriber);\n\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"}
|