UNPKG

rooks

Version:

Essential React custom hooks ⚓ to super charge your components!

17 lines 975 B
import type { ListenerOptions } from "@/types/utils"; /** * useGlobalObjectEventListener hook * * A react hook to an event listener to a global object * * @param {Window|Document} globalObject The global object to add event onto * @param {string} 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} when Should the event listener be active * @param {boolean} isLayoutEffect Should it use layout effect. Defaults to false * @see https://react-hooks.org/docs/useGlobalObjectEventListener */ declare function useGlobalObjectEventListener(globalObject: Document | Window, eventName: string, callback: EventListener, listenerOptions?: ListenerOptions, when?: boolean, isLayoutEffect?: boolean): void; export { useGlobalObjectEventListener }; //# sourceMappingURL=useGlobalObjectEventListener.d.ts.map