noleak-emitter
Wrapper for Simple Event Emitter ( ex1: "util('events').EventEmitter", ex2: "browser-emitter" ). On "error" or "end" event, you can unbind the listeners automatically.
Install
Install with npm:
npm install noleak-emitter
API - Set functions by args
// On node.js, "GLOBAL.Emitter" or "require('events').EventEmitter" // will be inherited. var NoleakEmitter = ; var emitter = ; emitter; emitter; // => 'a', 'b', 'c' emitter; ;
also use on browser
if you want to inherit Emitter to another class, use prototype chain.
// for Factory var { NoleakEmitter; } forvar i in NoleakEmitterprototype SubClassprototypei = NoleakEmitterprototypei; // for Singleton (not recommended) var { this__proto____proto__ = ; }