forked from codefellows/seattle-javascript-401d30
-
Notifications
You must be signed in to change notification settings - Fork 0
32 Socket.io
Jagdeep Singh edited this page Jun 29, 2019
·
1 revision
What is Socket.io?
- Keeps a pipe open between client and server
- Keeps communication pathway open
- Responds to events that one side or the other emits
- Publish an Event socket.emit('run', tellEveryoneToRun)
- Respond to an Event socket.on('run', doTheRunningMan)
- On the React side, you can respond to an event and add it's payload to state, or use a state change to trigger an emit