MCPcopy
hub / github.com/nanbingxyz/5ire / on

Method on

src/main/internal/emitter.ts:21–27  ·  view source on GitHub ↗

* Subscribe to a specific event * @template E Event name type * @param event - Event name to subscribe to * @param handler - Event handler function * @returns Function to unsubscribe

(event: E, handler: (payload: T[E]) => void)

Source from the content-addressed store, hash-verified

19 * @returns Function to unsubscribe
20 */
21 on<E extends keyof T>(event: E, handler: (payload: T[E]) => void) {
22 this.#emitter.on(event, handler);
23
24 return () => {
25 this.#emitter.off(event, handler);
26 };
27 }
28
29 /**
30 * Subscribe to all events

Callers 15

createStreamForMethod · 0.95
startFunction · 0.80
AppFunction · 0.80
ToolSetupFunction · 0.80
ContextMenuProviderFunction · 0.80
ChatFunction · 0.80
onFunction · 0.80
main.tsFile · 0.80
setupContextMenuMethod · 0.80
tables.tsFile · 0.80
allMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected