function hook
install
$ npm install bloody-functionhook
require
var hook =
api
hook(object, propertyName) > notifier
replaces object[propertyName]
by the hook function, and returns a notifier
.
notifier
notifier.on(event, cb)
"arguments"
fires when the arguments are accessible to the hook function"error"
fires if an error occurred"call"
fires when the function is called"return"
fires when the function has a result
notifier.count
(int)
the times the function was called
notifier.emit("destroy")
removes the hook
example
var view = cornea var notifier = var data = foo : "bar"notifierview