From 652e96db4b3ca8929deb46a3f1312edce17a140b Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 20 Apr 2019 21:34:49 -0500 Subject: [PATCH] refactor: open takes server not ctor --- packages/server/socket.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/server/socket.js b/packages/server/socket.js index 99147dd..63057c6 100644 --- a/packages/server/socket.js +++ b/packages/server/socket.js @@ -10,9 +10,8 @@ const decorateServer = compose( export class Server extends decorateServer(class {}) { - constructor(httpServer) { + constructor() { super(); - this.httpServer = httpServer; this.onConnect = this.onConnect.bind(this); } @@ -25,8 +24,8 @@ export class Server extends decorateServer(class {}) { this.emit('connect', new ServerSocket(socket)); } - open() { - this.io = new SocketServer(this.httpServer, { + open(httpServer) { + this.io = new SocketServer(httpServer, { parser: SocketIoParser, path: '/avocado', perMessageDeflate: false,