Sha256: 0162f5f33675f4852b851efc1b52d55335261416c4532c967c1babc5c0d6c1ab

Contents?: true

Size: 1.42 KB

Versions: 44

Compression:

Stored size: 1.42 KB

Contents

"use strict";

exports.__esModule = true;

var _map = require("babel-runtime/core-js/map");

var _map2 = _interopRequireDefault(_map);

var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require("babel-runtime/helpers/inherits");

var _inherits3 = _interopRequireDefault(_inherits2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Store = function (_Map) {
  (0, _inherits3.default)(Store, _Map);

  function Store() {
    (0, _classCallCheck3.default)(this, Store);

    var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this));

    _this.dynamicData = {};
    return _this;
  }

  Store.prototype.setDynamic = function setDynamic(key, fn) {
    this.dynamicData[key] = fn;
  };

  Store.prototype.get = function get(key) {
    if (this.has(key)) {
      return _Map.prototype.get.call(this, key);
    } else {
      if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
        var val = this.dynamicData[key]();
        this.set(key, val);
        return val;
      }
    }
  };

  return Store;
}(_map2.default);

exports.default = Store;
module.exports = exports["default"];

Version data entries

44 entries across 40 versions & 10 rubygems

Version Path
immosquare-cleaner-0.1.40 node_modules/babel-core/lib/store.js
ilog-0.4.1 node_modules/babel-core/lib/store.js
ilog-0.4.0 node_modules/babel-core/lib/store.js
ilog-0.3.3 node_modules/babel-core/lib/store.js
optimacms-0.4.3 spec/dummy/node_modules/babel-register/node_modules/babel-core/lib/store.js
optimacms-0.4.3 spec/dummy/node_modules/@rails/webpacker/node_modules/babel-core/lib/store.js
optimacms-0.4.3 spec/dummy/node_modules/babel-core/lib/store.js
optimacms-0.4.2 spec/dummy/node_modules/babel-register/node_modules/babel-core/lib/store.js
optimacms-0.4.2 spec/dummy/node_modules/@rails/webpacker/node_modules/babel-core/lib/store.js
optimacms-0.4.2 spec/dummy/node_modules/babel-core/lib/store.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/babel-core/lib/store.js
lux_assets-0.2.11 ./node_modules/babel-core/lib/store.js
lux_assets-0.2.9 ./node_modules/babel-core/lib/store.js
lux_assets-0.2.4 ./node_modules/babel-core/lib/store.js
lux_assets-0.2.2 ./node_modules/babel-core/lib/store.js
lux_assets-0.2.1 ./node_modules/babel-core/lib/store.js
locomotivecms-3.4.0 app/javascript/node_modules/babel-core/lib/store.js
cortex-0.1.3 spec/dummy/node_modules/babel-core/lib/store.js
dragonfly_puppeteer-0.1.0 node_modules/babel-core/lib/store.js
affiliator-0.2.1 node_modules/babel-core/lib/store.js