Closes an old websocket and opens a new one to the BaseURL
()
| 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 |
no test coverage detected