Executes all Promises in serial order and returns either the first result or throws an AggregateError containing all errors.
An optional defaultValue can be provided that will be returned if
promises is empty.
If no Promises and no defaultValue were provided undefined will
be returned.
Execute all Promises in serial
const promise = anySerial([
Promise.reject("err"),
Promise.resolve(1)
]);
promise.then(v => console.log(v)); // 1
a Promise that executes all Promises in serial
Generated using TypeDoc
Executes all Promises in serial order and returns either the first result or throws an AggregateError containing all errors.
An optional
defaultValuecan be provided that will be returned ifpromisesis empty.If no Promises and no
defaultValuewere providedundefinedwill be returned.Example
Execute all Promises in serial
Returns
a Promise that executes all Promises in serial