Creates a new Promise.
A callback used to initialize the promise. This callback is passed two arguments: a resolve callback used resolve the promise with a value or the result of another promise, and a reject callback used to reject the promise with a provided reason or error.
A reference to the prototype.
Constructs a new promise, similarly to the Promise constructor. The main difference is that definition
itself may return a promise (or be async).
If the promise returned by definition
rejects, the returned promise will also reject. Normally, this would cause the returned promise to hang.
The return type is meant to be P<T>
, where P
is the underlying promise type.
Converts the given Promise/A+ implementation into ExtendedPromise promise using this constructor.
The Promise/A+ implementation.
The return type is meant to be P<T>
, where P
is the underlying promise type.
Returns a promise that will never resolve or reject.
The return type is meant to be P<never>
, where P
is the underlying promise type.
Schedules an action to occur immediately but after current code has finished executing, using the Promise's scheduling mechanism.
This is similar to setTimeout(action, 0)
or setImmediate(action)
.
The acion to execute.
The return type is meant to be P<T>
, where P
is the underlying promise type.
Returns a promise that will wait for some time, and then resolve with the value given in value
(undefined by default).
If a number, the milliseconds to wait. If a date, the date to wait for.
The value to resolve with.
The return type is meant to be P<T>
, where P
is the underlying promise type.
Generated using TypeDoc
A promise constructor extended by all the functionality of
promise-stuff
.