ClassHelper helps creating classes easily
ClassHelper can be used either as node module or bower component.
npm i -S class-helper
const ClassHelper = require("class-helper");
bower i -S class-helper
<script src="bower_components/class-helper/build/class-helper.js"></script>
const Logger = ClassHelper.Factory({
log: function (...message)
{
console.log(...message);
}
});
const Greet = ClassHelper.Bound("greet", function ()
{
this.log("Hello " + this.getName());
});
const Person = ClassHelper({
constructor: function (_super, name)
{
this.name = name;
},
getName: function ()
{
return this.name;
}
}, [ Logger ], [ Greet ]);
const Me = ClassHelper({
constructor: function (_super)
{
_super("stefanwimmer128");
}
}, Person);
new Me().greet(); // Hello stefanwimmer128