mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
websocket implementation
This commit is contained in:
32
resources/js/store/modules/broadcasting.js
vendored
Normal file
32
resources/js/store/modules/broadcasting.js
vendored
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user