Thenable
Provides a more strict interface for Thenables in terms of http://promisesaplus.com for interop with .

Inheritance

Constructor

goog.Thenable()

Instance Methods

Public Protected Private
Defined in goog.Thenable
then(opt_onFulfilledopt_onRejectedopt_context) !goog.Promise.<RESULT>
Adds callbacks that will operate on the result of the Thenable, returning a new child Promise. If the Thenable is fulfilled, the onFulfilled callback will be invoked with the fulfillment value as argument, and the child Promise will be fulfilled with the return value of the callback. If the callback throws an exception, the child Promise will be rejected with the thrown value instead. If the Thenable is rejected, the onRejected callback will be invoked with the rejection reason as argument, and the child Promise will be rejected with the return value of the callback or thrown value.
Arguments:
opt_onFulfilled : ?(function(this:THIS, TYPE): (RESULT | IThenable.<RESULT> | Thenable))=
A function that will be invoked with the fulfillment value if the Promise is fullfilled.
opt_onRejected : ?(function(this:THIS, *): *)=
A function that will be invoked with the rejection reason if the Promise is rejected.
opt_context : THIS=
An optional context object that will be the execution context for the callbacks. By default, functions are executed with the default this.
Returns: !goog.Promise.<RESULT>  A new Promise that will receive the result of the fulfillment or rejection callback.
code »

Static Methods

goog.Thenable.addImplementation(ctor)
Marks a given class (constructor) as an implementation of Thenable, so that we can query that fact at runtime. The class must have already implemented the interface. Exports a 'then' method on the constructor prototype, so that the objects also implement the extern interface for interop with other Promise implementations.
Arguments:
ctor : function(new:goog.Thenable,...[?])
The class constructor. The corresponding class must have already implemented the interface.
code »
goog.Thenable.isImplementedBy(object) boolean
No description.
Arguments:
object : *
No description.
Returns: boolean  Whether a given instance implements goog.Thenable. The class/superclass of the instance must call addImplementation.
code »

Static Properties

goog.Thenable.IMPLEMENTED_BY_PROP :
An expando property to indicate that an object implements goog.Thenable. .
Code »

Package Thenable

Package Reference