0.2.0 • Published 9 years ago

ontrigger v0.2.0

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

ontrigger

light observer/eventemitter with only on and trigger methods

Travis CI

Why?

There are a lot of cases that only is used trigger and on methods of observer. This module only supply these methods.

Example:

var a = new Observer()

var x = ''

a.on('foo', function () {
    x += 'fizz'
})

a.on('foo', function () {
    x += 'buzz'
})

a.trigger('foo')

console.log(x) // fizzbuzz

Doc

See tests