import*as e from"react";function t(){var t=e.useRef(new Map),r=t.current,n=e.useCallback(((e,r,n,a)=>{t.current.set(n,{type:r,el:e,options:a}),e.addEventListener(r,n,a)}),[]),a=e.useCallback(((e,r,n,a)=>{e.removeEventListener(r,n,a),t.current.delete(n)}),[]);return e.useEffect((()=>()=>{r.forEach(((e,t)=>{a(e.el,e.type,t,e.options)}))}),[a,r]),{add:n,remove:a}}export{t as useEventListeners};
//# sourceMappingURL=use-event-listeners.js.map
