Answers for "socket io get user rooms"

0

socket io get user rooms

function getUserRooms(socket) {
    return Object.entries(rooms).reduce((names, [name, room]) => {
        if (room.users[socket.id] != null) names.push(name)
        return names
    }, [])
}
Posted by: Guest on February-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language