From the course: Node.js: Real-Time Web with Socket.IO

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Emit cheatsheet

Emit cheatsheet

From the course: Node.js: Real-Time Web with Socket.IO

Start my 1-month free trial

Emit cheatsheet

- [Instructor] On Socket.IO documentation, there is a very handy section where you can get a better overview of some popular commands you can do, so let's go through this cheat sheet. So, go to socket.io/docs/emit-cheatsheet/, and you can also get to the cheat sheet if you get from the main website, Docs, and then Emit Cheatsheet, right here. This is a good example of how you can transmit messages through the Socket.IO rooms, and what are the options. So, let's go through a few of them. So, this is the regular way of doing an emit to a specific room, but you could also emit to multiple rooms, so let's say, for example, we have the Javascript and the Swift room, and we want to emit to both of them. You could also emit to the Javascript and then the Swift room, and then emit the message, for example, this is the nice game event, and this is the message you want to send it to. There's also a way to do big messages to the entire namespace, so for example, if we wanted to send a message to…

Contents