src/components/text.js
function PromiseCache () {
  var cache = this.cache = {};

  this.get = function (key, promiseGenerator) {
    if (key in cache) {
      return cache[key];
    }
    cache[key] = promiseGenerator();
    return cache[key];
  };
}
function PromiseCache () {
  var cache = this.cache = {};

  this.get = function (key, promiseGenerator) {
    if (key in cache) {
      return cache[key];
    }
    cache[key] = promiseGenerator();
    return cache[key];
  };
}
function PromiseCache ( ) { var cache = this . cache = { } ; this . get = function ( key , promiseGenerator ) { if ( key in cache ) { return cache [ key ] ; } cache [ key ] = promiseGenerator ( ) ; return cache [ key ] ; } ; }
Get or create a promise given a key and promise generator.
@todo Move to a utility and use in other parts of A-Frame.
Get or create a promise given a key and promise generator .