MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / on

Method on

extensions/vscode/src/mcp/eventBus.ts:12–18  ·  view source on GitHub ↗
(type: CgcEventType, listener: Listener)

Source from the content-addressed store, hash-verified

10 private readonly listeners = new Map<CgcEventType, Set<Listener>>();
11
12 public on(type: CgcEventType, listener: Listener): () => void {
13 if (!this.listeners.has(type)) {
14 this.listeners.set(type, new Set());
15 }
16 this.listeners.get(type)!.add(listener);
17 return () => this.off(type, listener);
18 }
19
20 public off(type: CgcEventType, listener: Listener): void {
21 this.listeners.get(type)?.delete(listener);

Callers 12

activateFunction · 0.80
_subscribeEventsMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
ensureStartedMethod · 0.80
carousel.tsxFile · 0.80
setupChannelListenersMethod · 0.80
fetchGitlabArchiveFunction · 0.80
handleQueryFunction · 0.80
handlerFunction · 0.80
handlerFunction · 0.80

Calls 5

offMethod · 0.95
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected