added disconnect(), registerAccount(), socket.io funcs
This commit is contained in:
parent
1631f1b9ca
commit
ebc86ecc3c
@ -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();
|
Loading…
x
Reference in New Issue
Block a user