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) • 345 B
TypeScript
import { 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;