Retries a function multiple times until it succeeds or reaches the maximum number of retries.

  • Type Parameters

    • T extends unknown = any
    • P extends any[] = any[]

    Parameters

    • run: (...args: P) => Promise<T>

      The function to run.

    • Optionalcount: number

      The maximum number of retries (default is 5).

    Returns IWrappedFn<T, P>

    • The wrapped function that can be canceled.