From ed6a254bbb7c10845af4701343a806eea69a3a77 Mon Sep 17 00:00:00 2001 From: Benjamin Wegener Date: Tue, 2 Apr 2024 23:30:37 +0000 Subject: [PATCH] chore cleanup --- lib/WetSock/WetSock.js | 5 ++--- lib/index.js | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/WetSock/WetSock.js b/lib/WetSock/WetSock.js index feae80a..451d467 100644 --- a/lib/WetSock/WetSock.js +++ b/lib/WetSock/WetSock.js @@ -4,8 +4,8 @@ export default class WetSock { #clients = new Map(); #plugins = new Map(); constructor(config) { - this.config = config; - this.server = null; + this.#config = config; + this.#server = null; } start(server) { @@ -36,7 +36,6 @@ export default class WetSock { if(plugin.onMessage(ws.data.clientId, message)) break; // plugin consumes message by returning a truthy value } } - handleOpen(ws) { const client = this.#clients.get(ws.data.clientId); this.#plugins.forEach((plugin) => plugin.onOpen(ws.data.clientId)); diff --git a/lib/index.js b/lib/index.js index 16c97d6..d5d8b4b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,8 @@ -import WetSock from './WetSock'; import { resolve } from 'path'; +import WetSock from './WetSock'; + + const wetsock = new WetSock(); const server = Bun.serve({