From 6941c591a34ebdba3040209cecad3117d5120da3 Mon Sep 17 00:00:00 2001 From: Le Vivilet Date: Sun, 25 Aug 2024 10:51:38 +0200 Subject: [PATCH] feature: simplify code --- src/parts/WebSocketServer/WebSocketServer.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/parts/WebSocketServer/WebSocketServer.js b/src/parts/WebSocketServer/WebSocketServer.js index 85a68f0..cfe2c74 100644 --- a/src/parts/WebSocketServer/WebSocketServer.js +++ b/src/parts/WebSocketServer/WebSocketServer.js @@ -21,9 +21,6 @@ export const handleUpgrade = (request, socket) => { throw new TypeError(`socket must be of type Socket`) } const { promise, resolve } = Promises.withResolvers() - const upgradeCallback = (ws) => { - resolve(ws) - } - webSocketServer.handleUpgrade(request, socket, Buffer.alloc(0), upgradeCallback) + webSocketServer.handleUpgrade(request, socket, Buffer.alloc(0), resolve) return promise }