MCPcopy Create free account
hub / github.com/clientdb/clientdb / emit

Function emit

core/utils/eventManager.ts:79–91  ·  view source on GitHub ↗
(name: N, ...data: EventsMap[N])

Source from the content-addressed store, hash-verified

77 }
78
79 function emit<N extends keyof EventsMap>(name: N, ...data: EventsMap[N]) {
80 if (IS_DEV && DEV_DEBUG_EVENTS && debug) {
81 console.warn(`Event [${debug}]`, name, data);
82 }
83
84 runInAction(() => {
85 const listeners = getHandlersForEvent(name);
86
87 listeners.forEach((listener) => {
88 listener(...data);
89 });
90 });
91 }
92
93 function removeAllListeners() {
94 subscribersMap.clear();

Callers

nothing calls this directly

Calls 1

getHandlersForEventFunction · 0.85

Tested by

no test coverage detected