API Docs for: 3.11.0-git
Show:

Promise.EventNotifier Class

Constructor

Promise.EventNotifier

()

Item Index

Methods

Methods

addEvents

(
  • promise
)
Promise

Decorate a promise and register it and its kin as targets for notifications from this instance.

Returns the input promise.

Parameters:

  • promise Promise

    The Promise to add event support to

Returns:

decorate

(
  • promise
)
static

Decorate a Promise with an on method and make its then method propagate event support to its generated child promises.

Parameters:

  • promise Promise

    the Promise to add event support to

fire

(
  • type
  • [args*]
)
Promise.EventNotifier chainable

Notify registered Promises and their children of an event. Subscription callbacks will be passed additional args parameters.

Parameters:

  • type String

    The name of the event to notify subscribers of

  • [args*] Any optional

    Arguments to pass to the callbacks

Returns:

Promise.EventNotifier:

this instance