Promise
Summary
Create a lightweight Promise for async related work.
Constructor
aeris.util.aeris.Promise
Syntax
aeris.util.aeris.Promise
()
Summary
Item Index
Properties
Methods
adoptState_
Syntax
adoptState_
-
state
-
opt_args
Summary
Mark a promise with the specified state passing in an array of arguments
always
Syntax
always
-
callback
-
opt_ctx
Summary
Ensure a callback is called when the promise is either resolved or rejected.
bindCallbackToState_
Syntax
bindCallbackToState_
-
state
-
callback
-
opt_ctx
Summary
Ensure a callback is called when the promise adopts the specified state.
done
Syntax
done
-
callback
-
opt_ctx
Summary
Ensure a callback is called when the promise is resolved.
fail
Syntax
fail
-
callback
-
opt_ctx
Summary
Ensure a callback is called when the promise is rejected.
getState
Syntax
Summary
Returns:
The current state of the promise. 'pending', 'resolved', or 'rejected'.
proxy
Syntax
proxy
()
Summary
Resolve/reject the promise when the proxy promise is resolved/rejected.
reject
Syntax
reject
-
var_args
Summary
Mark a promise is rejected, passing in a variable number of arguments.
Parameters:
-
var_args
...*
resolve
Syntax
resolve
-
var_args
Summary
Mark a promise is resolved, passing in a variable number of arguments.
Parameters:
-
var_args
...*A variable number of arguments to pass to callbacks.
when
Syntax
Summary
Create a master promise from a combination of promises. Master promise is resolved when all component promises are resolved, or rejected when any single component promise is rejected.
Parameters:
-
var_args
...*A variable number of promises to wait for or an. array of promises.
Returns:
Master promise.
Properties
deferred_
Syntax
deferred_
Done: callbackStore, fail: callbackStore, always: callbackStore
private
Summary
An object containing deferred callbacks for resolved and rejected states.
state
Syntax
state
String
Summary
The current state of the promise (e.g. pending, resolved, or rejected).