Skip to content

Commit

Permalink
feature: simplify code (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Aug 25, 2024
1 parent c425181 commit cef7273
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/parts/WebSocketServer/WebSocketServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit cef7273

Please sign in to comment.