(type: EventType, handler: EventListener)
| 22 | handlers: EventListener[] = []; |
| 23 | |
| 24 | on(type: EventType, handler: EventListener) { |
| 25 | if (!this.handlers[type]) { |
| 26 | this.handlers[type] = []; |
| 27 | } |
| 28 | this.handlers[type].push(handler); |
| 29 | } |
| 30 | |
| 31 | emit(type: EventType, ...args) { |
| 32 | this.handlers[type]?.forEach((handler) => handler(...args)); |
no outgoing calls
no test coverage detected