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

Method to

lib/socket.ts:448–450  ·  view source on GitHub ↗

* Targets a room when broadcasting. * * @example * io.on("connection", (socket) => { * // the “foo” event will be broadcast to all connected clients in the “room-101” room, except this socket * socket.to("room-101").emit("foo", "bar"); * * // the code above is equivalent t

(room: Room | Room[])

Source from the content-addressed store, hash-verified

446 * @return a new {@link BroadcastOperator} instance for chaining
447 */
448 public to(room: Room | Room[]) {
449 return this.newBroadcastOperator().to(room);
450 }
451
452 /**
453 * Targets a room when broadcasting. Similar to `to()`, but might feel clearer in some cases:

Callers

nothing calls this directly

Calls 1

newBroadcastOperatorMethod · 0.95

Tested by

no test coverage detected