Skip to content

Commit

Permalink
[docs] Clarify private messaging in the emit cheatsheet (#3232)
Browse files Browse the repository at this point in the history
The previous version was confusing, as `socket.to(socket.id).emit()` does nothing.

Fixes #3220
  • Loading branch information
darrachequesne authored Apr 27, 2018
1 parent db831a3 commit 2917942
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/emit.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function onConnect(socket){
io.of('myNamespace').to('room').emit('event', 'message');

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

// sending with acknowledgement
socket.emit('question', 'do you think so?', function (answer) {});
Expand Down

0 comments on commit 2917942

Please sign in to comment.