test/widget-main/bower_components/core/scripts/modules/cache/factories.js
/**
     * Returns cached promise for the key if it exists.
     * Otherwise calls the function returning promise, and return it.
     *
     * @name lpCoreCachePromise
     * @memberof core.cache
     * @param   {Object}  options  Object containing:
     *   {String} key        Cache key
     *   {Function} promise  Function returning promise
     * @returns {Promise}
     * @ngFactory
     */
Returns cached promise for the key if it exists.
Otherwise calls the function returning promise, and return it.


Returns cached promise for the key if it exists . Otherwise calls the function returning promise and return it .
function cachePromise(options) {
        var promise = options.promise;
        var key = options.key;
        var promiseCache = cache.get(key);
        if (!promiseCache) {
            promiseCache = promise.call();
            cache.put(key, promiseCache);
        }
        return promiseCache;
    }
function cachePromise ( options ) { var promise = options . promise ; var key = options . key ; var promiseCache = cache . get ( key ) ; if ( ! promiseCache ) { promiseCache = promise . call ( ) ; cache . put ( key , promiseCache ) ; } return promiseCache ; }
Returns cached promise for the key if it exists.
Returns cached promise for the key if it exists .