pretty + socket separation

This commit is contained in:
Kevin Puig
2025-09-28 03:18:11 -04:00
parent 460991f2ae
commit b3e24f4493
5 changed files with 74 additions and 21 deletions

View File

@@ -0,0 +1,16 @@
import { Server } from "socket.io";
import { registerVoiceHandlers } from "./voiceHandler";
export function registerSocketHandlers(io: Server) {
// bad practice
io.on("connection", (socket) => {
console.log("connected");
socket.on("ping", (c) => {
console.log(c);
socket.emit("pong", c);
});
});
// good practice
registerVoiceHandlers(io);
}