Path: blob/trunk/third_party/closure/goog/promise/resolver.js
2868 views
// Copyright 2013 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314goog.provide('goog.promise.Resolver');15161718/**19* Resolver interface for promises. The resolver is a convenience interface that20* bundles the promise and its associated resolve and reject functions together,21* for cases where the resolver needs to be persisted internally.22*23* @interface24* @template TYPE25*/26goog.promise.Resolver = function() {};272829/**30* The promise that created this resolver.31* @type {!goog.Promise<TYPE>}32*/33goog.promise.Resolver.prototype.promise;343536/**37* Resolves this resolver with the specified value.38* @type {function((TYPE|goog.Promise<TYPE>|Thenable)=)}39*/40goog.promise.Resolver.prototype.resolve;414243/**44* Rejects this resolver with the specified reason.45* @type {function(*=): void}46*/47goog.promise.Resolver.prototype.reject;484950