A symbol property specifying that this is a promise.
Returns a promise that will await this
and all the promises in others
to resolve and yield their results in an array.
If a promise rejects, the returned promise will rejection with the reason of the first rejection.
The other promises that must be resolved with this one.
The return type is meant to be Self<T[]>
, where Self
is the promise type.
For use in TypeScript. Returns this
but statically typed as a Promise<S>
.
The return type is meant to be Self<S>
, where Self
is the promise type.
Attaches a callback for only the rejection of the Promise.
The callback to execute when the Promise is rejected.
A Promise for the completion of the callback. The return type is meant to be Self<T | TResult>
, where Self
is the current promise type.
Returns a promise that will wait after this
has finished, and then finish in the same way (resolving or rejecting).
If a number, the number of milliseconds to wait. If a date, the date to delay until.
Returns a promise that will execute the given callback if this
resolves, and then resolve with the same result.
The callback.
Returns a promise that will wait on this
promise followed by the promises (or other objects; see below) in others
, in order.
It will move on to the next promise once a previous finishes with a rejection. If all the promises reject, the returned promise will reject
with the last rejection.
Each of the arguments in others
can be:
One or more arguments used as fallbacks for this
promise.
Returns a promise that finishes when this
does, but in the opposite manner.
If this
resolves, the returned promise rejects with the value. If this
rejects, the returned promise will resolve with the rejection reason.
The return type is meant to be Self<S>
, where Self
is the promise type.
Returns a promise that will execute a callback whether this
resolves or rejects, and then finish the same way.
The callback will receive the rejection reason or result as an argument.
The action to perform.
Returns a promise that will race this
against the promises in others
and finish in the same way as the first promise that finishes.
Handles the rejections of all the promises.
The other promises to race against.
Returns a promise that acts like this
, but will finish no earlier than the given time (it will stall if this
finishes before this time, without resolving or rejecting).
If a number, the time to wait in milliseconds. If a date, the date to wait for.
Returns a promise that will return true
if this
resolves and false
if this
rejects. The returned promise always resolves.
Calling this method handles rejections by this
.
The return type is meant to be Self<boolean>
, where Self
is the promise type.
Attaches callbacks for the resolution and/or rejection of the Promise.
The callback to execute when the Promise is resolved.
The callback to execute when the Promise is rejected.
A Promise for the completion of which ever callback is executed. The return type is meant to be Self<TResult1 | TResult>
.
Returns a promise that waits for this
to finish for an amount of time depending on the type of deadline
.
If this
does not finish on time, onTimeout
will be called. The returned promise will then behave like the promise returned by onTimeout
.
If onTimeout
is not provided, the returned promise will reject with an Error.
Note that any code already waiting on this
to finish will still be waiting. The timeout only affects the returned promise.
If a number, the time to wait in milliseconds. If a date, the date to wait for.
Called to produce an alternative promise once this
expires. Can be an async function.
Generated using TypeDoc
A promise extended with all the extra functionality of 'promise-stuff'.