0.1.8 • Published 9 years ago

@zayesh/eventdispatcher v0.1.8

Weekly downloads
-
License
Zlib
Repository
github
Last release
9 years ago

EventDispatcher

Build status Windows Build status GitHub version npm version Dependencies

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;

// If you want Something to be a true sub-class of another class,
// you can just use the apply method for multi-inheritance:
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.

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago