MCPcopy
hub / github.com/coder/mux / createElectronClient

Function createElectronClient

src/browser/contexts/API.tsx:145–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143}
144
145function createElectronClient(): { client: APIClient; cleanup: () => void } {
146 const { port1: clientPort, port2: serverPort } = new MessageChannel();
147 window.postMessage("start-orpc-client", "*", [serverPort]);
148
149 const link = new MessagePortLink({ port: clientPort });
150 clientPort.start();
151
152 return {
153 client: createClient(link),
154 cleanup: () => clientPort.close(),
155 };
156}
157
158function createBrowserClient(
159 authToken: string | null,

Callers 1

ManagedAPIProviderFunction · 0.85

Calls 4

createClientFunction · 0.90
closeMethod · 0.65
postMessageMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected