March 2018
Intermediate to advanced
592 pages
13h 44m
English
In this part of the section, we'll talk about a different way to emit events. Some events you want to send to everybody: a new message should go to every single user, including the one who sent it so it can show up inside the list of messages. Other events, on the other hand, should only go to other people, so if user one emits an event, it shouldn't go back to user one, but instead go only to users two and three.
A good example of this is when a user joins a chatroom. I want to print a little message, like Andrew joined, when someone joins, and I want to print a message, like welcome Andrew, for the actual user who joined. So, in the first tab I would see welcome Andrew, and in the second tab I would see ...