(id)
| 68 | } |
| 69 | |
| 70 | removeCallback(id) { |
| 71 | let hasId = false |
| 72 | for (const [, callbacks] of this.#listener) { |
| 73 | if (callbacks.has(id)) { |
| 74 | callbacks.delete(id) |
| 75 | hasId = true |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | if (!hasId) { |
| 80 | throw Error(`Callback with id ${id} not found`) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | invokeCallbacks(eventType, data) { |
| 85 | const callbacks = this.#listener.get(eventType) |
no test coverage detected