unherit
Create a custom constructor which can be modified without affecting the original
class.
Install
npm:
npm install unherit
Use
var EventEmitter = require('events').EventEmitter
var unherit = require('unherit')
var Emitter = unherit(EventEmitter)
Emitter.prototype.defaultMaxListeners = 0
new Emitter().defaultMaxListeners === 0
new EventEmitter().defaultMaxListeners === undefined
new Emitter() instanceof EventEmitter
API
unherit(Super)
Create a custom constructor which can be modified without affecting the original
class.
Parameters
Super
(Function
) — Super-class
Returns
Function
— Constructor acting like Super
, which can be modified without
affecting the original class.
License
MIT © Titus Wormer