Ohm-Management - Projektarbeit B-ME
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.

onErrorResumeNext.js 763B

12345678910111213141516171819202122
  1. import { Observable } from '../Observable';
  2. import { from } from './from';
  3. import { isArray } from '../util/isArray';
  4. import { EMPTY } from './empty';
  5. export function onErrorResumeNext(...sources) {
  6. if (sources.length === 0) {
  7. return EMPTY;
  8. }
  9. const [first, ...remainder] = sources;
  10. if (sources.length === 1 && isArray(first)) {
  11. return onErrorResumeNext(...first);
  12. }
  13. return new Observable(subscriber => {
  14. const subNext = () => subscriber.add(onErrorResumeNext(...remainder).subscribe(subscriber));
  15. return from(first).subscribe({
  16. next(value) { subscriber.next(value); },
  17. error: subNext,
  18. complete: subNext,
  19. });
  20. });
  21. }
  22. //# sourceMappingURL=onErrorResumeNext.js.map