UNPKG

substate

Version:

Pub/Sub pattern with State Management

12 lines 464 B
import type { EventHandler, IEvents, IPubSub } from './PubSub.interface'; declare class PubSub implements IPubSub { events: IEvents; constructor(); on(eventName: string, fn: EventHandler): void; off(eventName: string, fn: EventHandler): void; removeAll(): void; removeAllOf(eventName: string): void; emit(eventName: string, data?: object): void; } export { type EventHandler, type IPubSub, PubSub }; //# sourceMappingURL=PubSub.d.ts.map