npm.io
1.0.0 • Published 6 years ago

p-fallback

Licence
MIT
Version
1.0.0
Deps
2
Size
3 kB
Vulns
0
Weekly
0
Stars
1

p-fallback Travis CI Build Status

Try to execute a list of promises until one succeeds.

NPM Badge

Install

npm install p-fallback

Usage

const pFallback = require("p-fallback");

const result = await pFallback([
	asyncOperation,
	otherAsyncOperation
]);

API

pFallback(promiseFunctions)
promiseFunctions

Type: Array<() => Promise>

The array of promise-returning functions to execute. An [AggregateError] is thrown if all of them fail.

Keywords