MCPcopy Index your code
hub / github.com/atomicdata-dev/atomic-data-browser / setWebSocket

Method setWebSocket

lib/src/store.ts:305–313  ·  view source on GitHub ↗

Closes an old websocket and opens a new one to the BaseURL

()

Source from the content-addressed store, hash-verified

303 // TODO: don't do this, have one websocket per domain
304 /** Closes an old websocket and opens a new one to the BaseURL */
305 setWebSocket(): void {
306 this.webSocket && this.webSocket.close();
307 // Check if we're running in a webbrowser
308 if (typeof window !== 'undefined') {
309 this.webSocket = startWebsocket(this);
310 } else {
311 console.warn('WebSocket not supported');
312 }
313 }
314
315 /**
316 * Registers a callback for when the a resource is updated. When you call

Callers 1

setServerUrlMethod · 0.95

Calls 1

startWebsocketFunction · 0.90

Tested by

no test coverage detected