UNPKG

beautiful-react-hooks

Version:

A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development

7 lines (6 loc) 350 B
import { type CallbackSetter } from './shared/types'; /** * Accepts an event name then returns a callback setter for a function to be performed when the event triggers. */ declare const useGlobalEvent: <TEvent extends Event>(eventName: keyof WindowEventMap, opts?: AddEventListenerOptions) => CallbackSetter<TEvent>; export default useGlobalEvent;