retry
Retries a failed Query with a specified configuration.
Formulae
retry(operation, config)
since v0.3.0
Operation could be a Query or a Mutation.
Config fields:
times
: number of Store with a number of attempts to retrydelay
: Sourced Time with an amount of milliseconds to wait before retryingfilter
: Sourced boolean with a predicate to decide whether to retry or notmapParams?
: optional mapper for the Query parameters mapping before the next retry, available overloads:(params, { attempt }) => mapped
{ source: Store, fn: (params, { attempt }, source) => mapped }
otherwise?
: Event or Effect, that will be called after the last attempt if the Query is still failed
Build-in delays
You can use the following delays:
linearDelay(base, opts)
exponentialDelay(base, opts)
Options:
randomize.spread
: number with a randomization spread, defaults to0