(subject: string)
| 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) { |
no outgoing calls
no test coverage detected