@sergonius/click-boss
v1.0.6
Published
Handle all clicks in a single listener
Downloads
26
Readme
click-boss
Handle all clicks in a single listener
Install
npm install --save @sergonius/click-boss
# or
yarn add @sergonius/click-boss
Example
import ClickBoss from '@sergonius/click-boss';
const elems = document.querySelectorAll('a');
elems.forEach(elem => {
const fn = event => {
event.preventDefault();
ClickBoss.removeEvent({ elem });
};
ClickBoss.addEvent({ elem, fn });
});