oncall

1.0.0 • Public • Published

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"

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i oncall

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • finnpauls