Skip to content
A simple class for handling events
JavaScript CoffeeScript PowerShell Shell Batchfile
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.idea
dist
src
test/karma
.editorconfig
.gitignore
.npmignore
.travis.yml
Gruntfile.js
LICENSE
README.md
bower.json
bower.templ.json
build.bat
build.js
build.ps1
build.sh
package.json
package.templ.json
version.json

README.md

EventHandler.js

Bower version npm version Build Status Coverage Status devDependency Status

Sauce Test Status

A simple class for handling events

Quick start

Several options are available to get started:

  • Download the latest release.
  • Clone the repo: git clone https://github.com/murrayju/EventHandler.js.git.
  • Install with Bower: bower install EventHandler.js.
  • Install with npm: npm install eventhandler.js.

Example

var evt = new EventHandler();

// Register a listener for this event
var handler = evt.on(function (someArg) {
  console.log('Event fired with arg: ' + someArg);
});

// Fire the event
evt.fire('test data');

// Unregister the listener when no longer needed
handler.off();

Credits

BrowserStack
A big thanks to BrowserStack for providing automated cross-browser testing!

Something went wrong with that request. Please try again.