type for the computed value
Transforms this Future instance into another Future instance using the given FutureTransformer function.
A transformer function
A transformed Future instance
Performs a computation.
A Computation instance
Transforms this Future instance by passing it through an array of FutureTransformer functions, wherein the final Future instance is returned.
An array of transformer functions.
Generated using TypeDoc
A deferred process/computation on a value.
Allows you to compose logic without starting the computation.
To begin a computation, a Future instance must be called with its
.get
method, which returns a Computation instance.// Create a Future that resolves the value 'Hello' after 500 ms. const delayedHello = Future.timer('Hello', 500); // Begin its computation const computation = delayedHello.get(); // You can cancel the computation // computation.cancel(); // Output the resolved value computation.then(console.log); // 'Hello'