From 7a70f63499e2be66b072543db8ebf928b6923633 Mon Sep 17 00:00:00 2001 From: Mikhail Dudin Date: Wed, 1 Dec 2021 02:03:43 +0300 Subject: [PATCH] docs: fix reconnection handling in the chat demo app (#4189) --- examples/chat/README.md | 2 +- examples/chat/public/main.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/chat/README.md b/examples/chat/README.md index f42c7395d8..f605c2d66c 100644 --- a/examples/chat/README.md +++ b/examples/chat/README.md @@ -6,7 +6,7 @@ A simple chat demo for Socket.IO ## How to use ``` -$ npm ci +$ npm i $ npm start ``` diff --git a/examples/chat/public/main.js b/examples/chat/public/main.js index 037648cc9c..a32cd3d315 100644 --- a/examples/chat/public/main.js +++ b/examples/chat/public/main.js @@ -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'); });