API reference@melon-db/sync
withRetry
@melon-db/sync — withRetry
Function: withRetry()
withRetry<
T>(fn,policy,options?):Promise<T>
Defined in: packages/melon-sync/src/retry.ts:57
Executes an async function with exponential backoff retries.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | () => Promise<T> |
policy | RetryPolicy |
options? | { onRetry?: (attempt, error) => void; signal?: AbortSignal; } |
options.onRetry? | (attempt, error) => void |
options.signal? | AbortSignal |
Returns
Promise<T>
