UNPKG

@logcomex/aylawc-core

Version:

An experimental library of web components

13 lines (12 loc) 360 B
export type EventDispatcherUnsubscribe = Function; export interface Event<V> { name: string; payload: V; } export declare class EventDispatcher { private _handlers; next<V>(event: Event<V>): void; subscribe<V = undefined>(name: string, fn: (payload?: V) => Function | void): Function; private unsubscribe; unsubscribeAll(): void; }