@sparkpost/matchbox
Version:
A React UI component library
14 lines (13 loc) • 383 B
TypeScript
/**
* 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;