ziggurat.js
Version:
a tiny modular js library for templates and other shorthands
27 lines (23 loc) • 607 B
JavaScript
// Generated by CoffeeScript 2.7.0
zg.mirror = class {
constructor(name1, _value, setters, options) {
this.name = name1;
Object.defineProperty(this, "v", {
get: function() {
return this._value;
},
set: function(val) {
// when V is set, also update the bound valus in HTML
this._value = val;
return this.update;
}
});
// also call the setter
this.setters = setters;
this.options = options;
this.v = _value;
}
};
zg.mirror_to_localstorage = function(value, name, options) {
return localStorage[name] = value;
};