Namespace: webdriver.promise
View Source

# class Callback_<T, R>

    webdriver.promise.Deferred<R>
      └ webdriver.promise.Callback_

All implemented interfaces:
  `webdriver.promise.Thenable<T>`

Manages a callback attached to a `webdriver.promise.Promise`. When the promise is resolved, this callback will invoke the appropriate callback function based on the promise's resolved value.

## new Callback_(parent, callback, errback, name, fn)

Parameters

parent`webdriver.promise.Promise`

  The promise this callback is attached to.

callback`?(function(T): (IThenable<R>|R))`

  The fulfillment callback.

errback`?(function(*): (IThenable<R>|R))`

  The rejection callback.

name`string`

  The callback name.

fn`Function`

  The function to use as the top of the stack when recording the callback's creation point.

## Instance Methods

### notify(state, value)code »

Called by the parent promise when it has been resolved.

Parameters

state`string`

  The parent's new state.

value`*`

  The parent's new value.