@mantine/hooks
Version:
A collection of 50+ hooks for state and UI management
15 lines (11 loc) • 375 B
JavaScript
'use client';
;
var React = require('react');
function useWindowEvent(type, listener, options) {
React.useEffect(() => {
window.addEventListener(type, listener, options);
return () => window.removeEventListener(type, listener, options);
}, [type, listener]);
}
exports.useWindowEvent = useWindowEvent;
//# sourceMappingURL=use-window-event.cjs.map