Skip to content

Commit 7a70f63

Browse files
authored
docs: fix reconnection handling in the chat demo app (#4189)
1 parent e5897dd commit 7a70f63

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/chat/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A simple chat demo for Socket.IO
66
## How to use
77

88
```
9-
$ npm ci
9+
$ npm i
1010
$ npm start
1111
```
1212

examples/chat/public/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ $(function() {
264264
log('you have been disconnected');
265265
});
266266

267-
socket.on('reconnect', () => {
267+
socket.io.on('reconnect', () => {
268268
log('you have been reconnected');
269269
if (username) {
270270
socket.emit('add user', username);
271271
}
272272
});
273273

274-
socket.on('reconnect_error', () => {
274+
socket.io.on('reconnect_error', () => {
275275
log('attempt to reconnect has failed');
276276
});
277277

0 commit comments

Comments
 (0)