javascript-hooker
javascript-hooker copied to clipboard
Hook a plain function
Hi Ben,
Is it possible to hook a simple function like a callback? See the code above? Maybe you can suggest how to do it?
hooker.hook(client, ['get'], {
pre: function () {
var url = arguments[0];
var cb = arguments[1];
hooker.hook(cb, {
once: true,
pre: function () {
var response = arguments[2];
// TODO: Put response to log...
}
});
}
});