1
0
forked from noxious/client

added disconnect(), registerAccount(), socket.io funcs

This commit is contained in:
Dennis Postma 2024-05-03 01:31:44 +02:00
parent 1631f1b9ca
commit ebc86ecc3c

View File

@ -8,6 +8,18 @@ class SocketioService {
setupSocketConnection(): void { setupSocketConnection(): void {
this.socket = io(config.server_endpoint as string); this.socket = io(config.server_endpoint as string);
} }
disconnect(): void {
if (this.socket) {
this.socket.disconnect();
}
}
registerAccount(account: string): void {
if (this.socket) {
this.socket.emit('register', account);
}
}
} }
export default new SocketioService(); export default new SocketioService();