Skip to content

Commit

Permalink
[docs] Update emit cheatsheet (socketio#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
FarazPatankar authored and darrachequesne committed Apr 3, 2017
1 parent 51c768e commit dd7099c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/emit.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function onConnect(socket){
// sending to all clients in namespace 'myNamespace', including sender
io.of('myNamespace').emit('bigger-announcement', 'the tournament will start soon');

// sending to a specific room in a specific namespace, including sender
io.of('myNamespace').to('room').emit('event', 'message');

// sending to individual socketid (private message)
socket.to(<socketid>).emit('hey', 'I just met you');

Expand Down

0 comments on commit dd7099c

Please sign in to comment.