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

Method subscribeWebSocket

lib/src/store.ts:335–348  ·  view source on GitHub ↗
(subject: string)

Source from the content-addressed store, hash-verified

333 }
334
335 subscribeWebSocket(subject: string): void {
336 if (subject == unknownSubject) {
337 return;
338 }
339 // TODO: check if there is a websocket for this server URL or not
340 try {
341 // Only subscribe if there's a websocket. When it's opened, all subject will be iterated and subscribed
342 if (this.webSocket?.readyState == 1) {
343 this.webSocket?.send(`SUBSCRIBE ${subject}`);
344 }
345 } catch (e) {
346 console.log(e);
347 }
348 }
349
350 unSubscribeWebSocket(subject: string): void {
351 if (subject == unknownSubject) {

Callers 2

subscribeMethod · 0.95
handleOpenFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected