Skip to content

This module aims to ease the retry of a function, using an exponential time between tries.

License

Notifications You must be signed in to change notification settings

prismamedia/ts-retry

Repository files navigation

TS Retry

About

This module aims to ease the retry of a function, using an exponential time between tries.

Getting started

Usage

import { retry } from '@prismamedia/retry';

try {
  const myResult = await retry(async () => {
    // Do my processing that may throw an Error

    return 2;
  });
} catch (err) {
  // Handle error after "n" tries
}

About

This module aims to ease the retry of a function, using an exponential time between tries.

Resources

License

Stars

Watchers

Forks

Packages

No packages published