websocket implementation

This commit is contained in:
Čarodej
2022-03-09 07:40:05 +01:00
parent 2a0b01e888
commit 8495ed5422
15 changed files with 1816 additions and 226 deletions

View File

@@ -0,0 +1,32 @@
const defaultState = {
isRunningConnection: false,
}
const actions = {
runConnection: ({ commit, getters }) => {
commit('SET_RUNNING_COMMUNICATION')
Echo.private(`test.${getters.user.data.id}`)
.listen('.Domain\\Notifications\\Events\\TestUpdate', (e) => {
console.log(e);
});
},
}
const mutations = {
SET_RUNNING_COMMUNICATION(state) {
state.isRunningConnection = true
},
}
const getters = {
isRunningConnection: (state) => state.isRunningConnection,
}
export default {
state: defaultState,
getters,
actions,
mutations,
}