UNPKG

@mr-samani/event-bus

Version:

A lightweight JavaScript event bus for any framework with auto-global support

10 lines (8 loc) 298 B
interface EventBus { events: Record<string, Array<(...args: any[]) => void>>; on(name: string, callback: (...args: any[]) => void): void; off(name: string): void; trigger(name: string, ...args: any[]): void; } declare const bus: EventBus; export { type EventBus, bus as default };