DisposableEmitter
An disposable-emitter powered by event-kit
Respects : eventemitter3, event-kit
Example
Emitter = require "disposable-emitter"someModule =#### Event listening##= ->consolelog "Event emitted!"disposer = someModuleon "event"listener#### Stop listening### EventEmitter stylesomeModuleoff "event"listener# DisposableEmitter styledisposerdispose#### Observe listener adding### observeAddListener(event, args...)someModulelockAutoEmit "initialized"null"arguments"# This listener call immediaty.someModuleonce "initialized"consolelog errmessagesetTimeout -># This listener will be call after 1secondssomeModuleon "initialized"consolelog errmessage1000#### Unobserve listener adding##someModuleunlockAutoEmit "initialized"# It is not called until it is emitted "initialized" event.someModuleon "initialized"consolelog errmessage#### Remove all listeners##someModuleremoveAllListeners# if you want dispose and disabled this instance.# Use or extends dispose method instead of removeAllListeners.someModuledisposesomeModuleon "event"-># => Error "Emitter has been disposed" thrown.