Skip to content

finnp/oncall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oncall

NPM

Emit events for method calls on an object. Keep in mind that this will modify the original objects methods.

var oncall = require('oncall')
var cat = {
  meow: function(sound) {
    return sound
  }
}

var calls = oncall(cat)
calls.on('meow', function(sound) {
  console.log('meow called with', sound)
})

cat.meow('MEOOOW') // prints "meow called with MEOOOW"

About

Emit events when methods of an object are called

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors