Join Alex Banks for an in-depth discussion in this video Removing disconnected audience members, part of Building a Polling App with Socket IO and React.js.
- At present, when an audience member joins…we are adding them to that audience array,…but when they disconnect we are not…removing them from that audience array.…This could lead to several problems,…and I actually have an instance of our server…running here on localhost:3000…to demonstrate those problems.…So we have three members joined,…we have Alex, we have Eve, and we have Mavis.…The problem occurs when Mavis leaves.…So if we close this tab, it still says there are…three audience members, although there are two.…And this problem intensifies when we open another tab…at localhost:3000 and join Mavis again.…
So now it says we have four audience members…but two of them are Mavis because…we never cleaned up the first Mavis.…So what we have to do is we have to remove…the audience members from the array when they leave.…So let's go ahead and do that.…I'm going to go ahead and close these browser windows down,…stop my server with "ctrl + c" and go over to Sublime.…So we're going to be doing all of this work…inside of the app server so I'm going to go ahead…
- 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
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.