MCPcopy
hub / github.com/codeaashu/claude-code / on

Method on

web/lib/collaboration/socket.ts:283–292  ·  view source on GitHub ↗
(
    type: T["type"],
    handler: EventHandler<T>
  )

Source from the content-addressed store, hash-verified

281 }
282
283 on<T extends CollabEvent>(
284 type: T["type"],
285 handler: EventHandler<T>
286 ): () => void {
287 if (!this.handlers.has(type)) {
288 this.handlers.set(type, new Set());
289 }
290 this.handlers.get(type)!.add(handler as EventHandler);
291 return () => this.off(type, handler);
292 }
293
294 off<T extends CollabEvent>(type: T["type"], handler: EventHandler<T>): void {
295 this.handlers.get(type)?.delete(handler as EventHandler);

Callers 15

useCollaborationFunction · 0.95
useCostSummaryFunction · 0.80
mainFunction · 0.80
getInputPromptFunction · 0.80
connectMethod · 0.80
readFileInRangeStreamingFunction · 0.80
constructorMethod · 0.80
enableFunction · 0.80
createSessionMethod · 0.80
execFunction · 0.80
startCapturingEarlyInputFunction · 0.80

Calls 5

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

Tested by

no test coverage detected