1.0.0 • Published 9 years ago

oncall v1.0.0

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

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"
1.0.0

9 years ago