Skip to content

Add attempt count in the try function #55

@letstri

Description

@letstri

It would be cool to be able to find out which attempt is currently underway. In my case, I want to send users a toast with information.

const result = await Result.tryPromise(
  ({ attempt }) => func(attempt),
  {
    retry: {
      times: 5,
      delayMs: 1000,
      backoff: 'constant',
    },
  },
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions