MCPcopy
hub / github.com/CapSoftware/Cap / on

Method on

packages/sdk-recorder/src/index.ts:77–89  ·  view source on GitHub ↗
(
		event: K,
		handler: EventHandler<K>,
	)

Source from the content-addressed store, hash-verified

75 }
76
77 on<K extends keyof RecorderEventMap>(
78 event: K,
79 handler: EventHandler<K>,
80 ): () => void {
81 if (!this.listeners.has(event)) {
82 this.listeners.set(event, new Set());
83 }
84 const set = this.listeners.get(event);
85 if (set) set.add(handler as EventHandler<keyof RecorderEventMap>);
86 return () => {
87 this.listeners.get(event)?.delete(handler);
88 };
89 }
90
91 private emit<K extends keyof RecorderEventMap>(
92 event: K,

Callers 15

useCapRecorderFunction · 0.95
schema.tsFile · 0.80
mainFunction · 0.80
spawnRustBenchmarkFunction · 0.80
spawnChromeFunction · 0.80
waitForCdpEventFunction · 0.80
mainFunction · 0.80
index.tsFile · 0.80
convertVideoToGifFunction · 0.80
runFfmpegFunction · 0.80
extractAudioFromUrlFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected