MCPcopy
hub / github.com/bombshell-dev/clack / setSubscriber

Method setSubscriber

packages/core/src/prompts/prompt.ts:79–86  ·  view source on GitHub ↗

* Set a subscriber with opts * @param event - The event name

(
		event: T,
		opts: { cb: ClackEvents<TValue>[T]; once?: boolean }
	)

Source from the content-addressed store, hash-verified

77 * @param event - The event name
78 */
79 private setSubscriber<T extends keyof ClackEvents<TValue>>(
80 event: T,
81 opts: { cb: ClackEvents<TValue>[T]; once?: boolean }
82 ) {
83 const params = this._subscribers.get(event) ?? [];
84 params.push(opts);
85 this._subscribers.set(event, params);
86 }
87
88 /**
89 * Subscribe to an event

Callers 2

onMethod · 0.95
onceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected