feat: implement SocketManager for websocket communication, creating a singleton instance and attaching it to the window object

This commit is contained in:
sebseb7
2025-07-23 07:19:54 +02:00
parent 9c3a4ee91b
commit d8f438c3f3

View File

@@ -0,0 +1,28 @@
import { io } from 'socket.io-client';
class SocketManager {
constructor() {
this.socket = io('', {
transports: ["websocket"],
autoConnect: false
});
this.emit = this.emit.bind(this);
}
emit(event, ...args) {
}
}
// Create singleton instance
const socketManager = new SocketManager();
// Attach to window object
window.socketManager = socketManager;
export default socketManager;