"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useWindowEvent = useWindowEvent;

var _react = require("react");

function useWindowEvent(eventName, callback) {
  (0, _react.useEffect)(() => {
    window.addEventListener(eventName, callback);
    return () => {
      window.removeEventListener(eventName, callback);
    };
  }, []);
}