(
names: N[],
handler: EventHandler<EventsMap[N]>
)
| 58 | } |
| 59 | |
| 60 | function onOneOf<N extends keyof EventsMap>( |
| 61 | names: N[], |
| 62 | handler: EventHandler<EventsMap[N]> |
| 63 | ) { |
| 64 | const cleanup = createCleanupObject(); |
| 65 | |
| 66 | for (const name of names) { |
| 67 | cleanup.next = on(name, handler); |
| 68 | } |
| 69 | |
| 70 | return () => { |
| 71 | cleanup.clean(); |
| 72 | }; |
| 73 | } |
| 74 | |
| 75 | function hasListeners<N extends keyof EventsMap>(name: N) { |
| 76 | return !!subscribersMap.get(name)?.size; |
nothing calls this directly
no test coverage detected