* Emit an event with data * @param event The event name to emit * @param args The data to pass to the event listeners
(event: string, ...args: unknown[])
| 38 | * @param args The data to pass to the event listeners |
| 39 | */ |
| 40 | emit(event: string, ...args: unknown[]): void { |
| 41 | if (this.events[event]) { |
| 42 | this.events[event].forEach((listener) => { |
| 43 | listener(...args); |
| 44 | }); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Remove all listeners for a specific event |
no outgoing calls