@mantine/hooks
Version:
A collection of 50+ hooks for state and UI management
13 lines (10 loc) • 345 B
JavaScript
'use client';
import { useEffect } from 'react';
function useWindowEvent(type, listener, options) {
useEffect(() => {
window.addEventListener(type, listener, options);
return () => window.removeEventListener(type, listener, options);
}, [type, listener]);
}
export { useWindowEvent };
//# sourceMappingURL=use-window-event.mjs.map