MCPcopy
hub / github.com/audreyt/ethercalc / emit

Function emit

packages/socketio-shim/src/client/legacy-io.ts:84–94  ·  view source on GitHub ↗
(event: string, data: unknown)

Source from the content-addressed store, hash-verified

82
83 return {
84 emit(event: string, data: unknown): void {
85 if (event !== 'data') return;
86 // Embeds send `socket.emit('data', {type:'execute',…})` — the
87 // payload is already a native ClientMessage.
88 try {
89 ws.send(typeof data === 'string' ? data : JSON.stringify(data));
90 } catch {
91 // Ignore send errors on a closed socket; embed will reconnect
92 // via its own retry loop.
93 }
94 },
95 on(event: string, cb: Listener): void {
96 (listeners[event] ??= []).push(cb);
97 },

Callers

nothing calls this directly

Calls 1

sendMethod · 0.65

Tested by

no test coverage detected