Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[docs] Update emit cheatsheet
  • Loading branch information
FarazPatankar committed Mar 31, 2017
commit 1e685b4ff171b9c8ed9a66a960a653a0cca1f5c5
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').in('room').emit('event', 'message');

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

Expand Down