docs: fix reconnection handling in the chat demo app (#4189)

This commit is contained in:
Mikhail Dudin
2021-12-01 02:03:43 +03:00
committed by GitHub
parent e5897dd7dc
commit 7a70f63499
2 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ A simple chat demo for Socket.IO
## How to use
```
$ npm ci
$ npm i
$ npm start
```

View File

@@ -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');
});