0.0.9 • Published 3 years ago

@zodash/timeout v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@zodash/timeout

Timeout a promise-returning or async function

Usage

import { timeout } from '@zodash/timeout';
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.9

3 years ago

0.0.8

3 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago