Melon-dbMelon-db
API reference@melon-db/sync

withRetry

@melon-db/sync — withRetry

@melon-db/sync API Reference


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

ParameterType
fn() => Promise<T>
policyRetryPolicy
options?{ onRetry?: (attempt, error) => void; signal?: AbortSignal; }
options.onRetry?(attempt, error) => void
options.signal?AbortSignal

Returns

Promise<T>