@frzr/inherit
v0.0.1
Published
simple class inheritance
Downloads
3
Readme
inherit
simple class inheritance
install
npm install @frzr/inherit
example
var inherit = require('@frzr/inherit')
function Model () {
console.log('constructor works')
Model.super.call(this)
}
function SuperModel () {
console.log('super call works')
}
inherit(Model, SuperModel)
Model.prototype.proto = function () {
console.log('proto works')
}
SuperModel.prototype.superproto = function () {
console.log('inherited proto works')
}
var model = new Model()
model.proto()
model.superproto()
console.log('is SuperModel:' + (model instanceof SuperModel))