Represents the result of an asynchronous operation.
Methods
catch(onRejected) :IPromise
Allows the holder of a IPromise
to receive a callback when it is rejected.
Parameters
Name | Type | Description |
---|---|---|
onRejected | IPromise~rejectedCallback |
Called when this instance is rejected. |
Returns
- Type
- IPromise
then(onFulfilled[, onRejected]) :IPromise
Allows the holder of a IPromise
to receive a callback when it is fulfilled or rejected.
Parameters
Name | Type | Description |
---|---|---|
onFulfilled | IPromise~fulfilledCallback |
Called when this instance is fulfilled. |
onRejected | IPromise~rejectedCallback |
Called when this instance is rejected. |
Returns
- Type
- IPromise
Type Definitions
fulfilledCallback([value])
This callback is invoked when the IPromise
is fulfilled.
Parameters
Name | Type | Description |
---|---|---|
value | Any |
The resulting value. |
rejectedCallback([reason])
This callback is invoked when the IPromise
is rejected.
Parameters
Name | Type | Description |
---|---|---|
reason | Any |
The reason as to why the |