github-pages-deploy-action/node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js
2020-03-06 22:45:40 -05:00

22 lines
763 B
JavaScript

import { Observable } from '../Observable';
import { from } from './from';
import { isArray } from '../util/isArray';
import { EMPTY } from './empty';
export function onErrorResumeNext(...sources) {
if (sources.length === 0) {
return EMPTY;
}
const [first, ...remainder] = sources;
if (sources.length === 1 && isArray(first)) {
return onErrorResumeNext(...first);
}
return new Observable(subscriber => {
const subNext = () => subscriber.add(onErrorResumeNext(...remainder).subscribe(subscriber));
return from(first).subscribe({
next(value) { subscriber.next(value); },
error: subNext,
complete: subNext,
});
});
}
//# sourceMappingURL=onErrorResumeNext.js.map