UNPKG

mitt-react

Version:

Lightweight utility for integrating mitt with React

8 lines (7 loc) 296 B
import { type EventMap } from "./types"; /** * Emits an event with the given name and data. * @param eventName - The name of the event. * @param data - The data to emit with the event. */ export declare function useEventEmit<T extends keyof EventMap>(eventName: T, data?: EventMap[T]): void;