Skip to content

Instantly share code, notes, and snippets.

@brian-lim-42
Created May 10, 2017 18:41
Show Gist options
  • Save brian-lim-42/91d52772267b9abee4246c48687a9117 to your computer and use it in GitHub Desktop.
Save brian-lim-42/91d52772267b9abee4246c48687a9117 to your computer and use it in GitHub Desktop.
Mustache Template
class {{clazz}} {
constructor(
{{#params}}
{{> param}}
{{/params}}
) {
{{#attribs}}
{{> attrib}}
{{/attribs}}
}
init(obj) {
var that = this;
Object.keys(obj).forEach(function (key) {
that.set(key, obj[key]);
});
}
get(value) {
return this[value];
}
set(key, value) {
this[key] = value;
}
}
module.exports = {{clazz}};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment