Skip to content

Operator proposal: retry #343

@sbeben

Description

@sbeben

This has been discussed in the community chat and marked as a good idea, since retrying async operations is a very common need in web applications.
I believe every second developer has done it in their own projects, so I think it would be nice to have something like:

type RetryParams<A, B, C> = {
  effect: Effect<A, B, C>
  times: number | Store<number>
  timeout: number | Store<number> | ((retryIndex: number (here we can also add params and error payload)) => number)
}

function retry<A, B, C>({
  effect,
  times,
  timeout,
}: RetryParams<A, B, C>): Effect<A, B, C>

I can provide my own implementation if the idea would be approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCSome new feature that should be discussed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions