MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / handleMessage

Function handleMessage

plugins/src/preload/rcp/socket.ts:29–37  ·  view source on GitHub ↗
(e: MessageEvent<string>)

Source from the content-addressed store, hash-verified

27});
28
29function handleMessage(e: MessageEvent<string>) {
30 const [type, endpoint, data] = JSON.parse(e.data);
31 if (type === 8 && listenersMap.has(endpoint)) {
32 const listeners = listenersMap.get(endpoint)!;
33 for (const callback of listeners) {
34 setTimeout(() => callback(<EventData>data), 0);
35 }
36 }
37}
38
39function buildApi(api: string): string {
40 if (api === 'all') return 'OnJsonApiEvent';

Callers

nothing calls this directly

Calls 2

hasMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected