1.0.0 • Published 5 years ago

@berish/try-call v1.0.0

Weekly downloads
5
License
MIT
Repository
gitlab
Last release
5 years ago

@berish/try-call

A method that allows a function to be called in multiple attempts. Supports different retry times, number of retries, and the ability to throw an error

Installation

$ npm install @berish/try-call --save

or

$ yarn add @berish/try-call

Supports typescript

Use case

import tryCall from '@berish/try-call';

const result = await tryCall(sendRequest, {
  canThrow: true,
  maxAttempts: 10,
  timeout: [100, 1000]
})