emity

0.0.3 • Public • Published

Build Status

Emity

A simple event system library. Supports Browser or Node environments.

Installation

npm install emity
bower install emity

Usage

var Emity = require('emity'); // For node
 
var emity   = new Emity();
var context = {};
 
## On
emity.on('something', function () {
  // do something
}, context);
 
 
## Emit
emity.emit('something'); // performs do something
 
emity.off('something');
 
emity.emit('something'); // nothing happens
 
## Off
emity.off('*'); // remove all events
emity.off(); // remove all events
 
## Once
emity.once('happens_once', function () {
  // do something
});
 
emity.emit('happens_once'); // will perform something
emity.emit('happens_once'); // nothing happens

Contribution & Setup

  • git clone git@github.com:djalmaaraujo/emity.git
  • npm install
  • Run the tests: npm test
  • Watch for file changes: npm run watch

License

MIT License © Djalma Araújo


cc company - Code Consultants and Open Source Coding

Package Sidebar

Install

npm i emity

Weekly Downloads

4

Version

0.0.3

License

MIT

Last publish

Collaborators

  • djalmaaraujo