MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / on

Method on

apps/cli/src/agent/extension-client.ts:294–296  ·  view source on GitHub ↗

* Subscribe to an event. * * Returns an unsubscribe function for easy cleanup. * * @param event - The event to subscribe to * @param listener - The callback function * @returns Unsubscribe function * * @example * ```typescript * const unsubscribe = client.on('stateChange', (event

(event: K, listener: (payload: ClientEventMap[K]) => void)

Source from the content-addressed store, hash-verified

292 * ```
293 */
294 on<K extends keyof ClientEventMap>(event: K, listener: (payload: ClientEventMap[K]) => void): () => void {
295 return this.emitter.on(event, listener)
296 }
297
298 /**
299 * Subscribe to an event, triggered only once.

Callers 3

onStateChangeMethod · 0.95
onWaitingForInputMethod · 0.95
onModeChangedMethod · 0.95

Calls 1

onMethod · 0.65

Tested by

no test coverage detected