mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 21:20:58 +00:00
13 lines
345 B
JavaScript
13 lines
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
|