0.0.10 • Published 2 years ago

@zodash/retry v0.0.10

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

@zodash/retry

Retry a promise-returning or async function

Usage

import { retry } from '@zodash/retry';
import * as fetch from 'node-fetch';

const run = async () => {
	const response = await fetch('https://sindresorhus.com/unicorn');

	// Abort retrying if the resource doesn't exist
	if (response.status === 404) {
		throw new Error(response.statusText);
	}

	return response.blob();
};

(async () => {
	console.log(await retry(run, {retries: 5}));
})();
0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago