mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 15:30:57 +00:00
15 lines
375 B
JavaScript
15 lines
375 B
JavaScript
'use client';
|
|
'use strict';
|
|
|
|
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
|