frontend/.pnpm-store/v3/files/44/f559a7c2fe2bc0d99d06e3ec0d2ab4a1482d015bd3a147f715313d6581f45deb0ee9e49abcb53994e690fd4e56d558f958e8735efbd79790daee9aa9afff9e

77 lines
3.0 KiB
Plaintext

/** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_innerSubscribe PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { from } from '../observable/from';
import { isArray } from '../util/isArray';
import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';
export function onErrorResumeNext() {
var nextSources = [];
for (var _i = 0; _i < arguments.length; _i++) {
nextSources[_i] = arguments[_i];
}
if (nextSources.length === 1 && isArray(nextSources[0])) {
nextSources = nextSources[0];
}
return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };
}
export function onErrorResumeNextStatic() {
var nextSources = [];
for (var _i = 0; _i < arguments.length; _i++) {
nextSources[_i] = arguments[_i];
}
var source = undefined;
if (nextSources.length === 1 && isArray(nextSources[0])) {
nextSources = nextSources[0];
}
source = nextSources.shift();
return from(source).lift(new OnErrorResumeNextOperator(nextSources));
}
var OnErrorResumeNextOperator = /*@__PURE__*/ (function () {
function OnErrorResumeNextOperator(nextSources) {
this.nextSources = nextSources;
}
OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
};
return OnErrorResumeNextOperator;
}());
var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(OnErrorResumeNextSubscriber, _super);
function OnErrorResumeNextSubscriber(destination, nextSources) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.nextSources = nextSources;
return _this;
}
OnErrorResumeNextSubscriber.prototype.notifyError = function () {
this.subscribeToNextSource();
};
OnErrorResumeNextSubscriber.prototype.notifyComplete = function () {
this.subscribeToNextSource();
};
OnErrorResumeNextSubscriber.prototype._error = function (err) {
this.subscribeToNextSource();
this.unsubscribe();
};
OnErrorResumeNextSubscriber.prototype._complete = function () {
this.subscribeToNextSource();
this.unsubscribe();
};
OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
var next = this.nextSources.shift();
if (!!next) {
var innerSubscriber = new SimpleInnerSubscriber(this);
var destination = this.destination;
destination.add(innerSubscriber);
var innerSubscription = innerSubscribe(next, innerSubscriber);
if (innerSubscription !== innerSubscriber) {
destination.add(innerSubscription);
}
}
else {
this.destination.complete();
}
};
return OnErrorResumeNextSubscriber;
}(SimpleOuterSubscriber));
//# sourceMappingURL=onErrorResumeNext.js.map