[]
        
(Showing Draft Content)

IPromise Interface

IPromise Interface

Defines the interface of promise which is used for asynchronous calling.

Heirarchy

  • IPromise

Methods

Methods

catch

  • Call the function after a promise is rejected.

    Parameters

    • onRejected: Object

      The function which will be executed when a promise is rejected. This has a single parameter, the rejection reason. The return value will be passed to the next callback function.

    Returns IPromise

    An IPromise equivalent to the value returned by onFulfilled/onRejected after being passed.

then

  • then(onFulfilled?: Object, onRejected?: Object): IPromise
  • Call the function after a promise is fulfilled or rejected.

    Parameters

    • Optional onFulfilled: Object

      The function which will be executed when a promise is fulfilled. This has a single parameter, the fulfillment value. If a value is returned, it will be passed to the next callback function. If no value is returned, the original value will be passed.

    • Optional onRejected: Object

      The function which will be executed when a promise is rejected. This has a single parameter, the rejection reason. If a value is returned, it will be passed to the next callback function. If no value is returned, the original value will be passed.

    Returns IPromise

    An IPromise equivalent to the value you return from onFulfilled/onRejected after being passed.