0.0.1 • Published 11 years ago
event-spy v0.0.1
Event Spy
WIP event spy. Useful for debugging purposes. Must be initialized at the top of your script.
Example
spy('click', function(e, fn) {
console.log('caught', e.type, e.target);
// pass through
fn.call(this, e);
});
Installation
$ component install matthewmueller/event-spy
API
spy(type, fn)
Spy on events. type
can either be a string or a regex. If no type
given, spy watches all events.
mouseover
andmousedown
events:
spy(/(mouseover|mousedown)/, fn);
- All events:
spy(fn);
spy#destroy()
Removes the spy
TODO
- fix removeEventListener()
- tests
License
MIT
0.0.1
11 years ago