Cliche.js
For the first time in a couple of weeks I’m releasing a new thing:
Cliche.js. It’s a small library for
mapping JavaScript click events. Instead of having to use
document.querySelector
and target.addEventListener
over and over again1
you can do this:
I think it looks pretty neat. For simplicity it currently only supports IE9+, but you can easily use a couple of polyfills to get it to work in other browsers.
event.target
with a few selected event listeners instead.
-
Although if you’re mapping a lot of events you probably should be using ↩