abstract Promise<T>(UnderlyingPromise<T>)
package thenshim
from UnderlyingPromise<T> to UnderlyingPromise<T>
Available on all platforms
Abstract over the target's promise implementation.
- On JS, the underlying promise is
js.lib.Promise
. - Otherwise, the underlying promise is
FallbackPromise
.
Static variables
staticfactory:PromiseFactory = new _Factory()
Factory that calls the methods to create promises on the current target.
- On JS, it is
JSPromiseFactory
- Otherwise, it is
FallbackPromiseFactory
Static methods
staticreject<T>(reason:Any):Promise<T>
Returns a settled promise that is rejected with the given reason.
staticresolve<T>(object:ValueOrPromiseLike<T>):Promise<T>
Constructor
new(executor:PromiseExecutor<T>)
Wrap an implementation as a JavaScript-style promise.
Parameters:
executor | Callback function with resolve and reject functions. |
---|
Methods
then<R>(onFulfilled:ThenableCallback<T, R>, ?onRejected:ThenableCallback<Any, R>):Promise<R>
Calls the given callbacks when this promise is settled.
See also:
Thenable.then
for callback descriptions.