MCPcopy
hub / github.com/socketio/socket.io / to

Method to

packages/socket.io/lib/socket.ts:355–357  ·  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

353 * @return a new {@link BroadcastOperator} instance for chaining
354 */
355 public to(room: Room | Room[]) {
356 return this.newBroadcastOperator().to(room);
357 }
358
359 /**
360 * 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