MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / onMessage

Function onMessage

apps/start/src/hooks/use-ws.ts:38–47  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

36 useWebSocket(baseUrl, {
37 shouldReconnect: () => true,
38 onMessage(event) {
39 try {
40 const data = getSuperJson<T>(event.data);
41 if (data !== null && data !== undefined) {
42 debouncedOnMessage(data);
43 }
44 } catch (error) {
45 console.error('Error parsing message', error);
46 }
47 },
48 });
49}

Callers

nothing calls this directly

Calls 2

getSuperJsonFunction · 0.90
errorMethod · 0.45

Tested by

no test coverage detected