MCPcopy
hub / github.com/CopilotKit/CopilotKit / on

Method on

packages/core/src/__tests__/test-utils.ts:339–346  ·  view source on GitHub ↗
(event: string, callback: (payload: any) => void)

Source from the content-addressed store, hash-verified

337 }
338
339 on(event: string, callback: (payload: any) => void): number {
340 if (!this.handlers.has(event)) {
341 this.handlers.set(event, []);
342 }
343 const ref = this.nextRef++;
344 this.handlers.get(event)!.push({ ref, callback });
345 return ref;
346 }
347
348 off(event: string, ref?: number): void {
349 if (!this.handlers.has(event)) return;

Callers

nothing calls this directly

Calls 4

pushMethod · 0.65
getMethod · 0.65
hasMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected