API Reference

Attempts to run a function up to a specified number of times and returns the result if successful. Also accepts an optional delay in ms between each attempt and fallback function if all calls are unsuccessful.

async function retry<T extends Func | AsyncFunc>(
  func: T,
  attempts: number,
  delay?: number,
  fallbackFn?: Func | AsyncFunc
)