wishthis/node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js
2022-01-21 09:28:41 +01:00

22 lines
No EOL
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