BVB Source Codes

reactide Show store.js Source code

Return Download reactide: download store.js Source code - Download reactide Source code - Type:.js
  1. "use strict";
  2.  
  3. exports.__esModule = true;
  4.  
  5. var _map = require("babel-runtime/core-js/map");
  6.  
  7. var _map2 = _interopRequireDefault(_map);
  8.  
  9. var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
  10.  
  11. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  12.  
  13. var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
  14.  
  15. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  16.  
  17. var _inherits2 = require("babel-runtime/helpers/inherits");
  18.  
  19. var _inherits3 = _interopRequireDefault(_inherits2);
  20.  
  21. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  22.  
  23. var Store = function (_Map) {
  24.   (0, _inherits3.default)(Store, _Map);
  25.  
  26.   function Store() {
  27.     (0, _classCallCheck3.default)(this, Store);
  28.  
  29.     var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this));
  30.  
  31.     _this.dynamicData = {};
  32.     return _this;
  33.   }
  34.  
  35.   Store.prototype.setDynamic = function setDynamic(key, fn) {
  36.     this.dynamicData[key] = fn;
  37.   };
  38.  
  39.   Store.prototype.get = function get(key) {
  40.     if (this.has(key)) {
  41.       return _Map.prototype.get.call(this, key);
  42.     } else {
  43.       if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
  44.         var val = this.dynamicData[key]();
  45.         this.set(key, val);
  46.         return val;
  47.       }
  48.     }
  49.   };
  50.  
  51.   return Store;
  52. }(_map2.default);
  53.  
  54. exports.default = Store;
  55. module.exports = exports["default"];
downloadstore.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top