Global

Type Definitions

AsyncNotifier()

Source:

Invoked when the wrapped Promise's scheduler is invoked.

Config

Source:
Properties:
Name Type Description
setAsyncNotifier SetAsyncNotifier

Registers a callback to invoke when the wrapped Promise's scheduler is used (e.g. when invoking success and failure handlers passed to .then(…)).

setErrorHandler SetErrorHandler

Registers a callback to invoke when done() is called on a rejected promise chain. The handler will be invoked with the rejection reason.

Provides methods to configure BloodhoundPromise.

Type:
  • Object

Defer

Source:
Properties:
Name Type Description
resolve function

Resolves the promise with the given value.

reject function

Rejects the promise with the given reason.

notify function

A no-op for backwards compatibility.

promise BloodhoundPromise

The promise that can be resolved or rejected using the provided methods.

Provides methods to resolve or reject a promise after is created.

Type:
  • Object

ErrorHandler(error)

Source:

Invoked when done() is called on a rejected promise.

Parameters:
Name Type Description
error any

The reason the promise rejected.

Executor(resolve, reject)

Source:

Passed to the BloodhoundPromise constructor. Invoked synchronously. Call resolve or reject to settle the promise.

Parameters:
Name Type Description
resolve function

Method to invoke to resolve the promise. Pass the resolved value.

reject function

Method to invoke to reject the promise. Pass the rejection reason.

SetAsyncNotifier(notifier)

Source:

Registers a callback to invoke when the wrapped Promise's scheduler is used (e.g. when invoking success and failure handlers passed to .then(…)).

Parameters:
Name Type Description
notifier AsyncNotifier

The callback to invoke when the wrapped Promise's scheduler is used.

SetErrorHandler(handler)

Source:

Registers a callback to invoke when done() is called on a rejected promise chain. The handler will be invoked with the rejection reason.

Parameters:
Name Type Description
handler ErrorHandler

The callback to invoke when done() is called on a rejected promise.