Rejects the promise with the specified reason.
Optionalreason: anyThe reason for rejecting the promise.
Resolves the promise with the specified value.
Optionalvalue: TThe value to resolve the promise with.
StaticallReturns a promise that fulfills with an array of results when all input promises fulfill. Rejects if any one rejects.
An iterable (array) of promises or values.
A promise that resolves with an array of results, or rejects if any input rejects.
StaticallReturns a promise that fulfills with an array of objects describing the outcome of each input promise, regardless of whether they fulfilled or rejected.
An iterable (array) of promises or values.
A promise that always resolves with an array of settlement results.
StaticanyReturns a promise that fulfills with the first fulfilled input promise. Rejects with an AggregateError if all promises reject (or if the array is empty).
An iterable (array) of promises or values.
A promise that resolves with the first fulfilled value, or rejects if all reject.
StaticraceStaticrejectStaticresolveStaticwith
HsPromiseis a custom implementation of a promise-like object. It provides methods for handling asynchronous operations, includingthen,catch, andfinally.