Interface IPromise

The promise API implemented by this library.

Index

Methods

Methods

public cancel()

Cancels the pending request represented by the Promise, and triggers the error callback if the promised event has not yet occurred.

public then(onSuccess: (response: T) => void, onError?: (error: any) => void, onProgress?: (progress: any) => void): IPromise

Adds event listeners for particular events.

Parameters

  • onSuccess: (response: T) => void

    Called when the promised event successfully occurs.

  • onError?: (error: any) => void optional

    Called when the promised event fails to occur. Could be an IError or an IJSError.

  • onProgress?: (progress: any) => void optional

    Called to indicate that the promised event is making progress toward completion.

Returns

IPromise