Future
Overview
The Future object provides a simple and powerful interface for accessing the eventual result of an asynchronous
operation.
Fields
.then
fn [V = Any](callback: fn (T) -> V | Future[V]) -> Future[V]Registers a callback to be called when this future is resolved.
.fails
fn (callback: fn (Any?) -> T | Future[T]) -> Future[T]Registers a callback to be called when this future is rejected.
Statics
.async
fn [F: Function](callback: F, ...args: Any) -> AnySpawns a Future from the given callback and arguments.
.delay
fn (millis?: Number, callback?: fn -> Void) -> Future[Void]Spawns a Future that runs its callback after a given delay.