View source

abstract thx.promise.Promise<T>(Future<Result<T, Error>>) from Future<Result<T, Error>> to Future<Result<T, Error>>

Available on all platforms

Class Fields

var nil(default,null):Promise<Nil>

function afterAll(arr:Array<Promise<Dynamic>>):Promise<Nil>

function all<T>(arr:Array<Promise<T>>):Promise<Array<T>>

function create<T>(callback:T -> Void -> Error -> Void -> Void):Promise<T>

function createFulfill<T>(callback:PromiseValue<T> -> Void -> Void):Promise<T>

function error<T>(err:Error):Promise<T>

function futureToPromise<T>(future:Future<T>):Promise<T>

function sequence(arr:Array<Promise<Dynamic>>):Promise<Nil>

function value<T>(v:T):Promise<T>

Instance Fields

function always(handler:Void -> Void):Void

function delay(?delayms:Int):Promise<T>

Available on java, js, swf

function either(success:T -> Void, failure:Error -> Void):Promise<T>

function failure(failure:Error -> Void):Promise<T>

function isFailure():Bool

function isResolved():Bool

inline function mapAlways<TOut>(handler:Void -> TOut):Future<TOut>

inline function mapAlwaysAsync<TOut>(handler:TOut -> Void -> Void):Future<TOut>

inline function mapAlwaysFuture<TOut>(handler:Void -> Future<TOut>):Future<TOut>

function mapEither<TOut>(success:T -> TOut, failure:Error -> TOut):Future<TOut>

function mapEitherFuture<TOut>(success:T -> Future<TOut>, failure:Error -> Future<TOut>):Future<TOut>

function mapFailure(failure:Error -> T):Future<T>

function mapFailureFuture(failure:Error -> Future<T>):Future<T>

function mapFailurePromise(failure:Error -> Promise<T>):Promise<T>

function mapSuccess<TOut>(success:T -> TOut):Promise<TOut>

function mapSuccessPromise<TOut>(success:T -> Promise<TOut>):Promise<TOut>

function success(success:T -> Void):Promise<T>

function throwFailure():Promise<T>

function toString():String