Refactor websocket handler

This commit is contained in:
Ken-Håvard Lieng 2015-06-17 00:46:58 +02:00
parent 047027ddec
commit 114bf8201e
8 changed files with 257 additions and 226 deletions

View file

@ -59,7 +59,7 @@ class Socket extends EventEmitter {
this.send('pong');
}
this.emit(msg.type, msg.response);
this.emit(msg.type, msg.data);
};
}
@ -68,7 +68,7 @@ class Socket extends EventEmitter {
}
send(type, data) {
this.ws.send(JSON.stringify({ type, request: data }));
this.ws.send(JSON.stringify({ type, data }));
}
setTimeoutPing() {