EventDispatcher

A supportive base class that enables any object to dispatch events to registered listeners.
Installation
This module can be installed from npm.
$ npm install @zayesh/eventdispatcher
Usage
import EventDispatcher from "@zayesh/eventdispatcher";
function Something() {
EventDispatcher.call(this);
}
Something.prototype = Object.create(EventDispatcher.prototype);
Something.prototype.constructor = Something;
EventDispatcher.prototype.apply(Something.prototype);
var sth = new Something();
sth.addEventListener("boom", function() {
alert("pow!");
});
sth.dispatchEvent({type: "boom"});
Documentation
API
Contributing
Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
License
Copyright (c) 2015 Raoul van Rueschen
Licensed under the Zlib license.