1.0.0 • Published 4 years ago

p-fallback v1.0.0

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

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.