import{useEffect as t}from"react";const e=(e,n)=>{t((()=>{const t=t=>{e.current&&!e.current.contains(t.target)&&n(t)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}),[e,n])};export{e as default};
