script.jsimport {useEffect} from '../preact@10.5.13/hooks.js';
export function useEventListener(element, type, listener, options) {
useEffect(() => {
element.addEventListener(type, listener, options);
return () => element.removeEventListener(type, listener, options);
}, [element, listener, options, type]);
}