function ioListenerOtherSocketJoinedLeftRoom(payload) {
		const { joined, roomName, username } = payload;
		//console.log(username + (joined ? " joining " : " leaving ") + roomName);
		// Find the room to modify
		const newMap = new Map(roomObjMap);
		const roomToModify = newMap.get(roomName);
		// User join room or leaving room
		if (joined) roomToModify.users.push(username);
		else {
			const userIndex = roomToModify.users.findIndex((nameInArray) => nameInArray.toLowerCase() === username.toLowerCase());
			roomToModify.users.splice(userIndex, 1);
		}
		// Update state
		setRoomObjMap(newMap);
	}
/**
	 * Listener function when OTHER socket Joined/Left a room
	 * @param {Object} payload
	 */
Listener function when OTHER socket Joined/Left a room
@param {Object} payload
Listener function when OTHER socket Joined / Left a room @param { Object } payload
function ioListenerOtherSocketJoinedLeftRoom(payload) {
		const { joined, roomName, username } = payload;
		const newMap = new Map(roomObjMap);
		const roomToModify = newMap.get(roomName);
		if (joined) roomToModify.users.push(username);
		else {
			const userIndex = roomToModify.users.findIndex((nameInArray) => nameInArray.toLowerCase() === username.toLowerCase());
			roomToModify.users.splice(userIndex, 1);
		}
		setRoomObjMap(newMap);
	}
function ioListenerOtherSocketJoinedLeftRoom ( payload ) { const { joined , roomName , username } = payload ; const newMap = new Map ( roomObjMap ) ; const roomToModify = newMap . get ( roomName ) ; if ( joined ) roomToModify . users . push ( username ) ; else { const userIndex = roomToModify . users . findIndex ( ( nameInArray ) => nameInArray . toLowerCase ( ) === username . toLowerCase ( ) ) ; roomToModify . users . splice ( userIndex , 1 ) ; } setRoomObjMap ( newMap ) ; }
Listener function when OTHER socket Joined/Left a room
 @param {Object} payload
Listener function when OTHER socket Joined / Left a room @param { Object } payload
//console.log(username + (joined ? " joining " : " leaving ") + roomName); // Find the room to modify // User join room or leaving room // Update state