ix
Version:
The Interactive Extensions for JavaScript
22 lines (20 loc) • 943 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.retry = void 0;
const repeatvalue_js_1 = require("../../iterable/repeatvalue.js");
const catcherror_js_1 = require("../catcherror.js");
/**
* Retries the async-iterable instance the number of given times. If not supplied, it will try infinitely.
*
* @template TSource The type of the elements in the source sequence.
* @param {number} [count=-1] An optional number of times to retry, otherwise is set to infinite retries
* @returns {MonoTypeOperatorAsyncFunction<TSource>} An async-iterable sequence producing the elements of the
* given sequence repeatedly until it terminates successfully.
*/
function retry(count = -1) {
return function retryOperatorFunction(source) {
return new catcherror_js_1.CatchAllAsyncIterable((0, repeatvalue_js_1.repeatValue)(source, count));
};
}
exports.retry = retry;
//# sourceMappingURL=retry.js.map