Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator proposal: retry #343

Open
sbeben opened this issue Dec 26, 2024 · 0 comments
Open

Operator proposal: retry #343

sbeben opened this issue Dec 26, 2024 · 0 comments

Comments

@sbeben
Copy link

sbeben commented Dec 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant