UNPKG

@sparkpost/matchbox

Version:
14 lines (13 loc) 383 B
/** * Handles global window event listeners in a reusable hook * @param {String} event * @param {Func} callback * * @example * function Component() { * useWindowEvent('resize', handleWindowResize); * ... * } */ declare function useWindowEvent<T extends keyof WindowEventMap>(event: T, callback: (e: WindowEventMap[T]) => void): void; export default useWindowEvent;