0.1.2 • Published 8 years ago

axy-events v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

axy-events

npm Build Status Coverage Status

An event emitter implementation.

It is not related to DOM-events.

Features:

  • add and remove listeners.
  • create listeners with limited number of calls.
  • event classes inheritance.
  • stopPropagation() and preventDefault().
  • handlers: bound context, arguments and data.

Classes and Interfaces

How to Use

NPM
npm install axy-events

Use (es6-module):

import Emitter from "axy-events";

emitter = new Emitter();

Default export of the library is Emitter class.

For CommonJS:

var Emitter = require("axy-events").default;
Browser (antiquated method)

Include the js-file from the /browser/ directory of this repo:

<script src="axy-events.min.js"></script>
var Emitter = axy.events;

// ...
Browser & NPM

Use webpack with NPM version.

TypeScript

See typescript section.

Building and testing

Required global gulp.

See gulpfile.js for more details.