Path: blob/trunk/third_party/closure/goog/promise/resolver.js
4575 views
/**1* @license2* Copyright The Closure Library Authors.3* SPDX-License-Identifier: Apache-2.04*/5goog.module('goog.promise.Resolver');6goog.module.declareLegacyNamespace();78const GoogPromise = goog.requireType('goog.Promise');9const Thenable = goog.requireType('goog.Thenable');1011/**12* Resolver interface for promises. The resolver is a convenience interface that13* bundles the promise and its associated resolve and reject functions together,14* for cases where the resolver needs to be persisted internally.15* @template TYPE16* @interface17*/18class Resolver {19constructor() {20/**21* The promise that created this resolver.22* @type {!GoogPromise<TYPE>}23*/24this.promise;25/**26* Resolves this resolver with the specified value.27* @type {function((TYPE|GoogPromise<TYPE>|Promise<TYPE>|IThenable|Thenable)=)}28*/29this.resolve;30/**31* Rejects this resolver with the specified reason.32* @type {function(*=): void}33*/34this.reject;35}36}3738exports = Resolver;394041