retryWhen.js 1.0 KB

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var operators_1 = require("rxjs/operators");
  4. /**
  5. * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
  6. * calls `error`, this method will emit the Throwable that caused the error to the Observable returned from `notifier`.
  7. * If that Observable calls `complete` or `error` then this method will call `complete` or `error` on the child
  8. * subscription. Otherwise this method will resubscribe to the source Observable.
  9. *
  10. * <img src="./img/retryWhen.png" width="100%">
  11. *
  12. * @param {function(errors: Observable): Observable} notifier - Receives an Observable of notifications with which a
  13. * user can `complete` or `error`, aborting the retry.
  14. * @return {Observable} The source Observable modified with retry logic.
  15. * @method retryWhen
  16. * @owner Observable
  17. */
  18. function retryWhen(notifier) {
  19. return operators_1.retryWhen(notifier)(this);
  20. }
  21. exports.retryWhen = retryWhen;
  22. //# sourceMappingURL=retryWhen.js.map