UNPKG

yj-tiny-signal

Version:

A tiny event dispatcher for JavaScript and TypeScript

9 lines (8 loc) 228 B
export declare class Signal<T = any> { private listeners; active: boolean; constructor(); add(listener: (event: T) => void): void; remove(listener: (event: T) => void): void; dispatch(event?: T): void; }