UNPKG

mitt-react

Version:

Lightweight utility for integrating mitt with React

8 lines (7 loc) 316 B
import { type EventCallback } from "./types"; /** * Registers event listeners using lifecycle hooks. * @param event - The event name to listen for. * @param callback - The callback to invoke when the event is emitted. */ export declare function useEventListener(eventName: string, handler: EventCallback): void;