0.0.1 • Published 12 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-spyAPI
spy(type, fn)
Spy on events. type can either be a string or a regex. If no type given, spy watches all events.
mouseoverandmousedownevents:
spy(/(mouseover|mousedown)/, fn);- All events:
spy(fn);spy#destroy()
Removes the spy
TODO
- fix removeEventListener()
- tests
License
MIT
0.0.1
12 years ago