mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-22 09:41:33 +03:00
20 lines
338 B
JavaScript
20 lines
338 B
JavaScript
class Sockets {
|
|
constructor() {
|
|
this.sockets = [];
|
|
}
|
|
|
|
registerSocket(name, socket) {
|
|
this.sockets.push({ name, socket });
|
|
}
|
|
|
|
getAllSockets() {
|
|
return this.sockets;
|
|
}
|
|
|
|
getSocket(name) {
|
|
const socket = this.sockets.find(socket => socket.name === name);
|
|
return socket;
|
|
}
|
|
}
|
|
|
|
module.exports = new Sockets(); |