The all function is similar to the builtin Promise.all or Promise.allSettled
functions. Given a list (or object) of promises, if any errors are thrown, all
errors are gathered and thrown in an AggregateError.
Using an Array
Passing an array as an argument will return the resolved promise values as an array in the same order.
Passing an object as an argument will return an object with the same keys and the values as the resolved promise values.
import*as
import _
_from'radashi'
const {
constuser:any
user } =await
import _
_.
all<{
user:any;
bucket:any;
message:any;
}>(input: {
user:any;
bucket:any;
message:any;
}):Promise<{
user:any;
bucket:any;
message:any;
}> (+2overloads)
export all
Check each property in the given object for a promise value. Wait
for all promises to resolve. Errors from rejected promises are
collected into an AggregateError.
The returned promise will resolve with an object whose keys are
identical to the keys of the input object. The values are the
resolved values of the promises.