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

Method to

packages/socket.io/lib/index.ts:890–892  ·  view source on GitHub ↗

* Targets a room when emitting. * * @example * // the “foo” event will be broadcast to all connected clients in the “room-101” room * io.to("room-101").emit("foo", "bar"); * * // with an array of rooms (a client will be notified at most once) * io.to(["room-101", "room-102"]).em

(room: Room | Room[])

Source from the content-addressed store, hash-verified

888 * @return a new {@link BroadcastOperator} instance for chaining
889 */
890 public to(room: Room | Room[]) {
891 return this.sockets.to(room);
892 }
893
894 /**
895 * Targets a room when emitting. Similar to `to()`, but might feel clearer in some cases:

Callers 12

messaging-many.tsFile · 0.45
uws.tsFile · 0.45
namespaces.tsFile · 0.45
index.jsFile · 0.45
index.tsFile · 0.45
index.jsFile · 0.45
index.jsFile · 0.45
index.jsFile · 0.45
index.tsFile · 0.45
index.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected