I want to check the connection state of Pusherjs
from $echo
in NuxtJs page.
when I use:
mounted(){
this.connection = this.$echo.connector.pusher.connection.state;
}
It works but it only set the initial connection status which is connecting
and it's static.
But when I use:
computed:{
connection: this.$echo.connector.pusher.connection.state
}
It returns error:
TypeError
Cannot read property '$echo' of undefined
So how can I be notified about connection status real time?