Class: Result

Result


new Result()

A Result represents a promise for the result of an async operation. It implements the standardised Promise/A+ spec.

Methods


then(onFulfilled, onRejected)

Chain a Result.

If the result resolves successfully, the onFulfilled callback is called with a single argument containing the value returned by the async operation.

If the result is rejected with an error, the onRejected callback is called with a single argument containing the error that was raised.

Parameters:
Name Type Description
onFulfilled Result.Fulfilled.<T>

The fulfilled callback

onRejected Result.Rejected

The rejected callback

Returns:

A new promise

Type
Result.<T>

Type Definitions


Fulfilled(value)

The callback that is invoked when a promise is fulfilled.

Parameters:
Name Type Description
value T

the promise value


Rejected(reason)

The callback that is invoked when a promise is rejected.

Parameters:
Name Type Description
reason Error

the promise rejected reason