Getting disconnect event in the channel web "views/lite/core/socket.tsx" script


I want to set up a handler when the socket gets disconnected and connected again. I want to refresh the conversation(due to some reason), but can somebody help me set up that handler on socket disconnect and connect.

Check the code: botpress/socket.tsx at fd8ee7af2c38361c9b20d1e001b3dc10c86224a0 · botpress/botpress · GitHub

We have access to four events in socket.tsx(‘guest.webchat.clear’, ‘guest.webchat.message’, ‘guest.webchat.typing’, ‘’), but below syntax doesn’t work'disconnect')

Can anybody help me?
Thank you