Skip to content

Commit

Permalink
docs: fix reconnection handling in the chat demo app (#4189)
Browse files Browse the repository at this point in the history
  • Loading branch information
mixaildudin authored Nov 30, 2021
1 parent e5897dd commit 7a70f63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A simple chat demo for Socket.IO
## How to use

```
$ npm ci
$ npm i
$ npm start
```

Expand Down
4 changes: 2 additions & 2 deletions examples/chat/public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ $(function() {
log('you have been disconnected');
});

socket.on('reconnect', () => {
socket.io.on('reconnect', () => {
log('you have been reconnected');
if (username) {
socket.emit('add user', username);
}
});

socket.on('reconnect_error', () => {
socket.io.on('reconnect_error', () => {
log('attempt to reconnect has failed');
});

Expand Down

0 comments on commit 7a70f63

Please sign in to comment.