class Promise<T>
- All implemented interfaces:
webdriver.promise.Thenable<T>
Represents the eventual value of a completed operation. Each promise may be in one of three states: pending, fulfilled, or rejected. Each promise starts in the pending state and may make a single transition to either a fulfilled or rejected state, at which point the promise is considered resolved.
new Promise(resolver, opt_flow)
Parameters
- resolver
function(function(?(T|IThenable<T>|{then: Function})=): ?, function(*=): ?): ? Function that is invoked immediately to begin computation of this promise's value. The function should accept a pair of callback functions, one for fulfilling the promise and another for rejecting it.
- opt_flow
?webdriver.promise.ControlFlow= The control flow this instance was created under. Defaults to the currently active flow.
Instance Methods
then(opt_callback, opt_errback)code »
Specified by: webdriver.promise.Thenable
Parameters
- opt_callback
?function(T): (R|IThenable<R>)=- opt_errback
?function(*): (R|IThenable<R>)=
Types
- Promise.State_
No description.