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
resolverfunction(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

cancel(opt_reason)code »

Specified by: webdriver.promise.Thenable


isPending()code »

Specified by: webdriver.promise.Thenable

Returns
boolean

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>)=

thenCatch(errback)code »

Specified by: webdriver.promise.Thenable

Parameters
errbackfunction(*): (R|IThenable<R>)

thenFinally(callback)code »

Specified by: webdriver.promise.Thenable

Parameters
callbackfunction(): (R|IThenable<R>)

toString()code »

Returns
string

Types

Promise.State_

No description.