7 lines
230 B
JavaScript
7 lines
230 B
JavaScript
|
function addDomEvent(target, eventName, handler, options = { passive: true }) {
|
||
|
target.addEventListener(eventName, handler, options);
|
||
|
return () => target.removeEventListener(eventName, handler);
|
||
|
}
|
||
|
|
||
|
export { addDomEvent };
|