True if the promise has been aborted.
The AbortSignal attached to this promise.
Abort this promise.
Optionalreason: stringAttaches a callback for only the rejection of the Promise.
Optionalonrejected: ((reason: E) => TResult | PromiseLike<TResult>) | nullThe callback to execute when the Promise is rejected.
A Promise for the completion of the callback.
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Optionalonfinally: (() => void) | nullThe callback to execute when the Promise is settled (fulfilled or rejected).
A Promise for the completion of the callback.
Attaches callbacks for the resolution and/or rejection of the Promise.
Optionalonfulfilled: ((value: A) => TResult1 | PromiseLike<TResult1>) | nullThe callback to execute when the Promise is resolved.
Optionalonrejected: ((reason: E) => TResult2 | PromiseLike<TResult2>) | nullThe callback to execute when the Promise is rejected.
A Promise for the completion of which ever callback is executed.
StaticallCreates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
An array of Promises.
A new Promise.
StaticallOptionalabort: AbortSignalStaticallCreates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
An array of Promises.
A new Promise.
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
An array of Promises.
A new Promise.
StaticanyThe any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
An array or iterable of Promises.
A new Promise.
The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
An array or iterable of Promises.
A new Promise.
StaticfromWrap any PromiseLike in an AbortablePromise.
This will make the promise resolution abortable, but it has no way of aborting the promise while it's running.
Optionalabort: AbortSignalStaticraceStaticraceOptionalabort: AbortSignalStaticrejectCreates a new rejected promise for the provided reason.
Optionalreason: anyThe reason the promise was rejected.
A new rejected Promise.
StaticresolveCreates a new resolved promise.
Optionalvalue: A | PromiseLike<A>A resolved promise.
StaticrunCreate a new AbortablePromise using an AbortableExecutor function and an optional AbortSignal.
A function which receives two callbacks resolve and
reject used to resolve or reject the promise, and an
AbortSignal which should be passed on to any abortable jobs
triggered by the function.
Optionalabort: AbortSignalAn optional AbortSignal which can be used to abort
the promise externally instead of calling its abort() method.
StatictryTakes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result in a Promise.
A function that is called synchronously. It can do anything: either return a value, throw an error, or return a promise.
Additional arguments, that will be passed to the callback.
A Promise that is:
StaticwithCreates a new Promise and returns it in an object, along with its resolve and reject functions.
An object with the properties promise, resolve, and reject.
const { promise, resolve, reject } = Promise.withResolvers<T>();
A promise that can be aborted using an AbortSignal.