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
Prev Previous commit
Update emit.md
Add example of how to emit to a room within a namespace.
  • Loading branch information
FarazPatankar authored Mar 31, 2017
commit 7d014d9b82f98a147e15ae0ac2c59397ea861070
2 changes: 1 addition & 1 deletion docs/emit.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function onConnect(socket){
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');
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