UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

19 lines (17 loc) 739 B
import { repeatValue } from '../repeatvalue'; import { catchAll } from '../catcherror'; /** * Retries the iterable instance the number of given times. If not supplied, it will try infinitely. * * @export * @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 iterable sequence producing the elements of the * given sequence repeatedly until it terminates successfully. */ export function retry(count = -1) { return function retryOperatorFunction(source) { return catchAll(repeatValue(source, count)); }; } //# sourceMappingURL=retry.mjs.map