First pass at connecting to console and rendering the output from the server.

This commit is contained in:
Dane Everitt
2019-06-29 17:18:17 -07:00
parent 6db9f65e0f
commit e0838c895a
3 changed files with 27 additions and 11 deletions

View File

@@ -39,15 +39,13 @@ export class Websocket extends EventEmitter {
this.socket.open();
}
json (data: any) {
this.socket.json(data);
}
reconnect () {
this.socket.reconnect();
}
send (data: any) {
this.socket.send(data);
send (event: string, payload?: string | string[]) {
this.socket.send(JSON.stringify({
event, args: Array.isArray(payload) ? payload : [ payload ],
}));
}
}