Completable provides the base support for promises. This interface satisfies the Promised interface, to be used when a Promise is needed.

By: Julien Viet

no type hierarchy

Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: Promised<Value>
Methods
alwaysSource Codeshared Promise<Result> always<Result>(Callable<Result,Value|[Throwable]> callback)

Compose with a function that accepts either a Value or a Throwable.

Parameters:
  • callback

    A function that accepts either the promised value or a Throwable.

composeSource Codeshared Promise<Result> compose<Result>(Callable<Promisable<Result>,Value> onFulfilled, Promisable<Result>(Throwable) onRejected = ...)

Compose and return a Promise

Parameters:
  • onFulfilled

    A function that is called when fulfilled.

  • onRejected = rethrow

    A function that is called when rejected.

handleSource Codeshared formal Promise<Result> handle<Result>(Callable<Promise<Result>,Value> onFulfilled, Promise<Result>(Throwable) onRejected)
onCompleteSource Codeshared void onComplete(Callable<Anything,Value> onFulfilled, Anything(Throwable) onRejected = ...)

When completion happens, the provided function will be invoked.

Parameters:
  • onFulfilled

    A function that is called when fulfilled.

  • onRejected = rethrow

    A function that is called when rejected.

Inherited Methods
Methods inherited from: Object