p-fallback
v1.0.0
Published
Try to execute a list of promises until one succeeds.
Downloads
3
Maintainers
Readme
p-fallback
Try to execute a list of promises until one succeeds.
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.