@berish/try-call
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@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]
})

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i @berish/try-call

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    8.48 kB

    Total Files

    13

    Last publish

    Collaborators

    • quadraticstudio