Skip to content

Commit dd7099c

Browse files
FarazPatankardarrachequesne
authored andcommitted
[docs] Update emit cheatsheet (socketio#2906)
1 parent 51c768e commit dd7099c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/emit.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function onConnect(socket){
2525
// sending to all clients in namespace 'myNamespace', including sender
2626
io.of('myNamespace').emit('bigger-announcement', 'the tournament will start soon');
2727

28+
// sending to a specific room in a specific namespace, including sender
29+
io.of('myNamespace').to('room').emit('event', 'message');
30+
2831
// sending to individual socketid (private message)
2932
socket.to(<socketid>).emit('hey', 'I just met you');
3033

0 commit comments

Comments
 (0)