Skip to content

light observer/eventemitter with only on and trigger methods

License

Notifications You must be signed in to change notification settings

xgbuils/ontrigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

light observer/eventemitter with only on and trigger methods

Resources

License

Stars

Watchers

Forks

Packages

No packages published