const socket = io.connect(url, { reconnection: false }) socket.on('update', data => console.log(data)) socket.on('connect_error', err => handleErrors(err)) socket.on('connect_failed', err => handleErrors(err)) socket.on('disconnect', err => handleErrors(err))