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 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  2. import * as tslib_1 from "tslib";
  3. import { from } from '../observable/from';
  4. import { isArray } from '../util/isArray';
  5. import { OuterSubscriber } from '../OuterSubscriber';
  6. import { InnerSubscriber } from '../InnerSubscriber';
  7. import { subscribeToResult } from '../util/subscribeToResult';
  8. export function onErrorResumeNext() {
  9. var nextSources = [];
  10. for (var _i = 0; _i < arguments.length; _i++) {
  11. nextSources[_i] = arguments[_i];
  12. }
  13. if (nextSources.length === 1 && isArray(nextSources[0])) {
  14. nextSources = nextSources[0];
  15. }
  16. return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };
  17. }
  18. export function onErrorResumeNextStatic() {
  19. var nextSources = [];
  20. for (var _i = 0; _i < arguments.length; _i++) {
  21. nextSources[_i] = arguments[_i];
  22. }
  23. var source = null;
  24. if (nextSources.length === 1 && isArray(nextSources[0])) {
  25. nextSources = nextSources[0];
  26. }
  27. source = nextSources.shift();
  28. return from(source, null).lift(new OnErrorResumeNextOperator(nextSources));
  29. }
  30. var OnErrorResumeNextOperator = /*@__PURE__*/ (function () {
  31. function OnErrorResumeNextOperator(nextSources) {
  32. this.nextSources = nextSources;
  33. }
  34. OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
  35. return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
  36. };
  37. return OnErrorResumeNextOperator;
  38. }());
  39. var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) {
  40. tslib_1.__extends(OnErrorResumeNextSubscriber, _super);
  41. function OnErrorResumeNextSubscriber(destination, nextSources) {
  42. var _this = _super.call(this, destination) || this;
  43. _this.destination = destination;
  44. _this.nextSources = nextSources;
  45. return _this;
  46. }
  47. OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) {
  48. this.subscribeToNextSource();
  49. };
  50. OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) {
  51. this.subscribeToNextSource();
  52. };
  53. OnErrorResumeNextSubscriber.prototype._error = function (err) {
  54. this.subscribeToNextSource();
  55. this.unsubscribe();
  56. };
  57. OnErrorResumeNextSubscriber.prototype._complete = function () {
  58. this.subscribeToNextSource();
  59. this.unsubscribe();
  60. };
  61. OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
  62. var next = this.nextSources.shift();
  63. if (!!next) {
  64. var innerSubscriber = new InnerSubscriber(this, undefined, undefined);
  65. var destination = this.destination;
  66. destination.add(innerSubscriber);
  67. subscribeToResult(this, next, undefined, undefined, innerSubscriber);
  68. }
  69. else {
  70. this.destination.complete();
  71. }
  72. };
  73. return OnErrorResumeNextSubscriber;
  74. }(OuterSubscriber));
  75. //# sourceMappingURL=onErrorResumeNext.js.map