Connection in the MainLayout.vue file
echo.private('ApplicationUpdateChannel.'+String(userData.value?.branch_id))
.listen('.ApplicationUpdateEvent', (e:any)=>{
if(e){
$store.dispatch('ApplicationModule/fetchList')
}
})
Connection to the same event in same channel in the Application.vue file but with different conditions
echo.private('ApplicationUpdateChannel.'+String(userData.value?.branch_id))
.listen('.ApplicationUpdateEvent', (e:any)=>{
if(e){
$store.dispatch('ApplicationModule/fetchList')
if ($route.params.id && $route.params.id === e.id) {
fetchData()
}
}
})