This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
55 lines
1.4 KiB
"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"]; |