MCPcopy Create free account
hub / github.com/clientdb/clientdb / getHandlersForEvent

Function getHandlersForEvent

core/utils/eventManager.ts:33–45  ·  view source on GitHub ↗
(
    name: N
  )

Source from the content-addressed store, hash-verified

31 >();
32
33 function getHandlersForEvent<N extends keyof EventsMap>(
34 name: N
35 ): Set<EventHandler<EventsMap[N]>> {
36 const existingSet = subscribersMap.get(name);
37
38 if (existingSet) return existingSet;
39
40 const newSet = new Set<EventHandler<unknown[]>>();
41
42 subscribersMap.set(name, newSet);
43
44 return newSet;
45 }
46
47 function on<N extends keyof EventsMap>(
48 name: N,

Callers 2

onFunction · 0.85
emitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected