Type Definitions
AsyncNotifier()
Invoked when the wrapped Promise's scheduler is invoked.
Config
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 |
setErrorHandler |
SetErrorHandler | Registers a callback to invoke when |
Provides methods to configure BloodhoundPromise.
Type:
- Object
Defer
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)
Invoked when done() is called on a rejected promise.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
any | The reason the promise rejected. |
Executor(resolve, reject)
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)
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)
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 |