First pass at connecting to console and rendering the output from the server.
This commit is contained in:
parent
6db9f65e0f
commit
e0838c895a
3 changed files with 27 additions and 11 deletions
|
@ -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 ],
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue