Laravel Echo error handling (with Pusher)

Viewed 2740

Is there any guide about this topic? I have read the pusher documentation and it seems fairly easy to manage a disconnect with a code similar to the following:

pusher.connection.bind('disconnected', function() {
    // Do Something
})

I'm not sure how to integrate it with Echo, since my code is as follows:

window.EchoConnection = new Echo({
    broadcaster: 'pusher',
    key: window.EchoKey,
    cluster: 'eu',
    encrypted: true
});

EDIT: in order to check a disconnect event, run window.EchoConnection.connector.pusher.connection.disconnect() in your console

1 Answers
Related