Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Promise models a promise for a future value. This class has platform specific behaviors.

Type parameters

  • T

Hierarchy

  • SDKPromise

Index

Constructors

Properties

Methods

Constructors

constructor

  • Create a new promise.

    Parameters

    • Optional init: function
        • (T: any, any: any): void
        • Parameters

          • T: any
          • any: any

          Returns void

    Returns SDKPromise

Properties

id

id: number

The identifier of the promise

Methods

catchError

  • catchError(rejectCallback: function): any
  • Add a handler to catch an error.

    Parameters

    • rejectCallback: function

      the error handler.

        • (any: any): void
        • Parameters

          • any: any

          Returns void

    Returns any

setId

  • setId(id: number): void
  • Set the identifier.

    Parameters

    • id: number

    Returns void

then

  • then(fulfillCallback: function, rejectCallback?: function): any
  • Add handlers to process the response or catch an error.

    Parameters

    • fulfillCallback: function

      the response handler.

        • (T: any): void
        • Parameters

          • T: any

          Returns void

    • Optional rejectCallback: function

      the optional error handler.

        • (any: any): void
        • Parameters

          • any: any

          Returns void

    Returns any