rooks
Version:
Collection of awesome react hooks
16 lines (15 loc) • 760 B
TypeScript
import type { ListenerOptions } from "../types/utils";
/**
* useWindowEventListener hook
*
* A react hook to an event listener to the window
*
* @param {keyof WindowEventMap} eventName The event to track
* @param {Function} callback The callback to be called on event
* @param {ListenerOptions} listenerOptions The options to be passed to the event listener
* @param {boolean} isLayoutEffect Should it use layout effect. Defaults to false
* @returns {undefined}
* @see https://rooks.vercel.app/docs/hooks/useWindowEventListener
*/
declare function useWindowEventListener(eventName: keyof WindowEventMap, callback: (...args: unknown[]) => void, listenerOptions?: ListenerOptions, isLayoutEffect?: boolean): void;
export { useWindowEventListener };