How to use the join function from socket.io

Find comprehensive JavaScript socket.io.join code examples handpicked from public code repositorys.

28
29
30
31
32
33
34
35
36
37
    users.push(socket.username);
});
socket.on('new_room', (data, callback) => {
    callback(true);
    socket.roomnum = data;
    socket.join("room-" + socket.roomnum);
    userrooms[data] = [];
    userrooms[data].push(socket.id);
    // console.log(userrooms);
    let hostData = { socketName: socket.username, "userRoom": userrooms }
fork icon0
star icon0
watch icon1

+ 5 other calls in file