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.

        • (...args): Promise<T>
        • Parameters

          • Rest...args: P

          Returns Promise<T>

    • count: number = 5

      The maximum number of retries (default is 5).

    Returns IWrappedFn<T, P>

    • The wrapped function that can be canceled.