(data: string)
| 63 | } |
| 64 | |
| 65 | private _sendData(data: string): void { |
| 66 | // TODO: do something better than just swallowing |
| 67 | // the data if the socket is not in a working condition |
| 68 | if (this._socket.readyState !== 1) { |
| 69 | return; |
| 70 | } |
| 71 | this._socket.send(data); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | function addSocketListener<K extends keyof WebSocketEventMap>( |