2023-02-08 12:35:10 +00:00
|
|
|
import { Observable } from '../Observable';
|
2022-06-08 10:36:39 +00:00
|
|
|
import { argsOrArgArray } from '../util/argsOrArgArray';
|
2023-02-08 12:35:10 +00:00
|
|
|
import { OperatorSubscriber } from '../operators/OperatorSubscriber';
|
|
|
|
import { noop } from '../util/noop';
|
|
|
|
import { innerFrom } from './innerFrom';
|
2022-06-08 10:36:39 +00:00
|
|
|
export function onErrorResumeNext(...sources) {
|
2023-02-08 12:35:10 +00:00
|
|
|
const nextSources = argsOrArgArray(sources);
|
|
|
|
return new Observable((subscriber) => {
|
|
|
|
let sourceIndex = 0;
|
|
|
|
const subscribeNext = () => {
|
|
|
|
if (sourceIndex < nextSources.length) {
|
|
|
|
let nextSource;
|
|
|
|
try {
|
|
|
|
nextSource = innerFrom(nextSources[sourceIndex++]);
|
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
subscribeNext();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const innerSubscriber = new OperatorSubscriber(subscriber, undefined, noop, noop);
|
|
|
|
nextSource.subscribe(innerSubscriber);
|
|
|
|
innerSubscriber.add(subscribeNext);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
subscriber.complete();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
subscribeNext();
|
|
|
|
});
|
2022-06-08 10:36:39 +00:00
|
|
|
}
|
|
|
|
//# sourceMappingURL=onErrorResumeNext.js.map
|