more cleanup and better to have some prop drilling but just stay balanced here

This commit is contained in:
talksik
2022-05-07 08:15:23 -05:00
parent 5a08ea6226
commit 1959405450
4 changed files with 25 additions and 46 deletions
+7
View File
@@ -29,6 +29,10 @@ const socketIdsToUserIds: {
export default function InitializeWs(io: any) {
console.log("initializing web sockets");
setInterval(() => {
console.log(socketIdsToUserIds);
}, 5000);
return io
.use(function (socket: any, next: any) {
console.log("authenticating user...");
@@ -163,6 +167,9 @@ export default function InitializeWs(io: any) {
// notify everyone of this disconnection
console.log("user disconnected");
console.log(
`list of sockets mappings in memory: ${socketIdsToUserIds}`
);
});
});
}