createLoopbackHub

function
devtools-ui/src/transport/loopback.ts:201
signature
createLoopbackHub(): LoopbackHub

Creates a self-contained in-memory DevTools hub plus the two client transports that connect to it, a socketFactory for the store agent and a WebSocket-compatible class for the panel UI. No ports, no server, no extension: everything runs in the current process.

Returns

LoopbackHub

Example

example
const hub = createLoopbackHub();
withDevtools(store, { port: 0, socketFactory: hub.agentSocketFactory });
// <DevtoolsApp config={{ port: 0, WebSocket: hub.WebSocket }} />