W3cubDocs

/Haxe JavaScript

Promise<T>

package js

@:native("Promise") Available on js

Constructor

new (init:T ‑> Void ‑> Dynamic ‑> Void ‑> Void)

Throws:

null DOMError

Methods

@:native("catch") catchError<TOut> (rejectCallback:EitherType<Dynamic ‑> Void, PromiseCallback<Dynamic, TOut>>):Promise<TOut>

then<TOut> (fulfillCallback:Null<PromiseCallback<T, TOut>>, ?rejectCallback:EitherType<Dynamic ‑> Void, PromiseCallback<Dynamic, TOut>>):Promise<TOut>

Static methods

static all (iterable:Array<Dynamic>):Promise<Array<Dynamic>>

static race (iterable:Array<Dynamic>):Promise<Dynamic>

static reject<T> (?value:Dynamic):Promise<T>

static resolve<T> (?value:T ):Promise<T>

static resolve<T> (promise:Promise<T>):Promise<T>

static resolve<T> (thenable:Thenable<T>):Promise<T>

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/Promise.html