• Provides exponential backoff for a given operation.

    Type Parameters

    • T

    Parameters

    • operation: (() => Promise<T>)

      the async operation to perform

        • (): Promise<T>
        • Returns Promise<T>

    • Optional options: Partial<BackoffOptions>

      optional backoff options

    Returns Promise<T>

    • the result of the operation if successful

    Throws

    • the last error if all attempts fail