eventy

An object event injection.

npm install eventy
24 downloads in the last week
52 downloads in the last month

eventy

An object event injection.

Installation

npm install eventy

Quick Start

var eventy = require('eventy');

function onUpdate(value) {
  console.log(value);
}

var user = {}
eventy(user);
user.on('update', onUpdate);
user.trigger('update', 'dead');
user.off('update', onUpdate);

Global Uses

var Eventy = require('eventy');

var Events = new Eventy();

function me() {
  Events.on('hi', function(message) {
    console.log(message);
  })  
}

function you() {
  Events.trigger('hi', 'from you');
}

me();
you();

Copyright (c) 2013 Shallker Wang - MIT License (enclosed)

npm loves you