"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useGlobalEvent = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const useGlobalEvent = (eventName, callback) => {
    React.useEffect(() => {
        window.addEventListener(eventName, callback);
        return () => window.removeEventListener(eventName, callback);
    }, [eventName, callback]);
};
exports.useGlobalEvent = useGlobalEvent;
