0.0.5 • Published 9 years ago

light-event v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

light-event

lightweight pubSub pattern event for javascript.

Installation

  $ npm install light-event

on(event, fn)

var LE = require('light-event');

var e = new LE;

e.on('sayHi', function (data) {
    console.log('hi, ' + data);
})

e.trigger('sayHi', 'light-event'); // hi, light-event

once(event, cb)

Register a one-time event which will be removed immediately after been invoked.

trigger(event)

Trigger Events!

off(event, fn1, fn2..)

Cancel events or some specific callbacks inside one event

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.1

9 years ago