Skip to content

@statesync/core


@statesync/core / withRetry

Function: withRetry()

ts
function withRetry<T>(
   provider, 
   policy?, 
onRetry?): SnapshotProvider<T>;

Defined in: retry.ts:36

Wraps a SnapshotProvider with retries using exponential backoff.

On each failed attempt, onRetry is called (if provided) — you can use it for logging or cancellation.

Type Parameters

Type Parameter
T

Parameters

ParameterType
providerSnapshotProvider<T>
policy?RetryPolicy
onRetry?(info) => void

Returns

SnapshotProvider<T>

Released under the MIT License.