UNPKG

mitt-vue

Version:

Lightweight utility for integrating mitt with Vue 2 and Vue 3

11 lines (10 loc) 386 B
import { Emitter } from 'mitt'; import { EventMap } from './types'; declare const emitter: Emitter<EventMap>; export default emitter; /** * 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 eventEmit<T extends keyof EventMap>(eventName: T, data?: EventMap[T]): void;