Join Alex Banks for an in-depth discussion in this video Responding with a joined event, part of Building a Polling App with Socket IO and React.js.
- When the server receives a joint event from the audience,…we need to respond to the client to let them know…that we have received that information successfully.…So we're going to do so by opening up our app-server…and starting here on line 21,…where we listen for the join event…and we have this callback handler,…we're going to add some more code to the callback handler.…So instead of just console logging the audience member,…the first we're going to do is we're going to create…a variable to store this new member.…And this is going to be an object literal,…because what we're going to do is we're going to store…the member's name along with their socket id.…
So we'll give this literal an id of this.…This inside of this callback function here…refers to the socket.…So this is our current socket,…or the one socket that just emitted a join event.…This socket has a unique id.…So the member id, we are just going to go ahead…and associate with the socket id.…Next, the member also has a name…and we can get that information from our payload,…
- Setting up the environment
- Connecting sockets
- Handling disconnects
- Setting up the React.js router
- Passing state to child components as properties
- Joining the presentation
- Starting and running the presentation
- Asking and answering questions
- Graphing results
- Upgrading to ES6
Skill Level Intermediate
Building a Responsive Single-Page Design with Sasswith Ray Villalobos4h 55m Intermediate
1. Setting Up the Environment
Setting up npm scripts4m 22s
2. Connecting Sockets
3. App State and Routes
4. Joining the Presentation
5. Starting the Presentation
6. Questions and Answers
7. Graphing Results on a Scoreboard
8. Upgrading to ES6 Syntax
Next steps1m 1s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.