MCPcopy Index your code
hub / github.com/socketio/socket.io / join

Method join

lib/socket.ts:554–561  ·  view source on GitHub ↗

* Joins a room. * * @example * io.on("connection", (socket) => { * // join a single room * socket.join("room1"); * * // join multiple rooms * socket.join(["room1", "room2"]); * }); * * @param {String|Array} rooms - room or array of rooms * @return a Promis

(rooms: Room | Array<Room>)

Source from the content-addressed store, hash-verified

552 * @return a Promise or nothing, depending on the adapter
553 */
554 public join(rooms: Room | Array<Room>): Promise<void> | void {
555 debug("join room %s", rooms);
556
557 return this.adapter.addAll(
558 this.id,
559 new Set(Array.isArray(rooms) ? rooms : [rooms])
560 );
561 }
562
563 /**
564 * Leaves a room.

Callers 15

constructorMethod · 0.95
_onconnectMethod · 0.95
attachAppMethod · 0.45
sendFileMethod · 0.45
utility-methods.tsFile · 0.45
messaging-many.tsFile · 0.45
socket.tsFile · 0.45
uws.tsFile · 0.45
namespaces.tsFile · 0.45
index.jsFile · 0.45
index.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected