Static variables

@:value(((NeverFuture.inst : FutureObject<Dynamic>)))staticNEVER:Future<Dynamic> = ((NeverFuture.inst : FutureObject<Dynamic>))

@:value(Future.sync(Noise))staticNOISE:Future<Noise> = Future.sync(Noise)

@:value(Future.sync(null))staticNULL:Future<Dynamic> = Future.sync(null)

Static methods

staticinlineasPromise<T>(s:Surprise<T, Error>):Promise<T>

Casts a Surprise into a Promise

@:value({ lazy : false })@:noUsingstaticasync<A>(f:A ‑> Void ‑> Void, lazy:Bool = false):Future<A>

Creates an async future * Example: var i = Future.async(function(cb) cb(1)); // Future<Int>

@:noUsingstaticdelay<T>(ms:Int, value:Lazy<T>):Future<T>

staticflatten<A>(f:Future<Future<A>>):Future<A>

Flattens Future<Future<A>> into Future<A>

@:noUsingstaticinlineisFuture(maybeFuture:Dynamic):Bool

@:noUsingstaticinlinelazy<A>(l:Lazy<A>):Future<A>

@:value({ gather : true })staticofMany<A>(futures:Array<Future<A>>, gather:Bool = true):Future<Array<A>>

Merges multiple futures into Future>

@:noUsingstaticinlinesync<A>(v:A):Future<A>

Creates a sync future. * Example: var i = Future.sync(1); // Future<Int>

@:noUsingstaticinlinetrigger<A>():FutureTrigger<A>

Creates a new FutureTrigger

Methods

@:implfirst(other:Future<T>):Future<T>

Creates a future that contains the first result from this or other

@:value({ gather : true })@:implinlineflatMap<A>(next:T ‑> Future<A>, gather:Bool = true):Future<A>

Creates a new future by applying a transform function to the result. * Different from map, the transform function of flatMap returns a Future

@:value({ gather : true })@:implinlinemap<A>(f:T ‑> A, gather:Bool = true):Future<A>

Creates a new future by applying a transform function to the result. * Different from flatMap, the transform function of map returns a sync value

@:value({ gather : true })@:implmerge<A, R>(other:Future<A>, merger:(T, A) ‑> R, gather:Bool = true):Future<R>

Merges two futures into one by applying the merger function on the two future values

@:implnext<R>(n:Next<T, R>):Promise<R>

Like map and flatMap but with a polymorphic transformer and return a Promise * @see Next