@epikodelabs/streamix / src/public-api / retry
Function: retry()
retry<
T>(factory,maxRetries?,delay?):Atom<T>
Defined in: projects/libraries/streamix/src/lib/factories/retry.ts:17
Creates an atom that subscribes to a source factory and retries the entire sequence on error.
Values are yielded as each attempt produces them. If an attempt fails after emitting some values, those values stay visible downstream and the operator restarts the factory for the next attempt.
Type Parameters
T
T = any
The type of values emitted by the source stream.
Parameters
factory
() => PipeInput<T>
A factory function executed on each initialization attempt.
maxRetries?
MaybePromise<number> = 3
The maximum number of retry operations allowed. A value of 0 runs a single attempt.
delay?
MaybePromise<number> = 1000
The delay window in milliseconds to pause between attempts.
Returns
Atom<T>
An atom that retries the sequence factory after errors.