led-canvas-led
Version:
Example LED class to be used by https://github.com/marionebl/led-canvas
50 lines (42 loc) • 1.08 kB
JavaScript
;
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var _extends = function (child, parent) {
child.prototype = Object.create(parent.prototype, {
constructor: {
value: child,
enumerable: false,
writable: true,
configurable: true
}
});
child.__proto__ = parent;
};
var Store = require("./store");
var Styles = (function (Store) {
var Styles = function Styles(initial) {
Store.call(this, initial);
};
_extends(Styles, Store);
_classProps(Styles, null, {
factory: {
writable: true,
value: function (initial) {
return new Styles(initial);
}
},
forEach: {
writable: true,
value: function (callback) {
var _this = this;
Object.keys(this._).forEach(function (key) {
callback(key, _this.get(key));
});
}
}
});
return Styles;
})(Store);
module.exports = Styles;