mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Merge pull request #39 from michgeek/master
Add namespaced mutation for Vuex
This commit is contained in:
commit
8589bbfb65
2 changed files with 7 additions and 5 deletions
4
dist/build.js
vendored
4
dist/build.js
vendored
File diff suppressed because one or more lines are too long
|
@ -41,8 +41,12 @@ export default class{
|
||||||
|
|
||||||
if(type.split('_')[0].toUpperCase() === 'SOCKET'){
|
if(type.split('_')[0].toUpperCase() === 'SOCKET'){
|
||||||
|
|
||||||
if(this.store._mutations[type])
|
for (let namespaced in this.store._mutations) {
|
||||||
this.store.commit(type, payload)
|
let mutation = namespaced.split('/').pop()
|
||||||
|
|
||||||
|
if (mutation === type)
|
||||||
|
this.store.commit(namespaced, payload)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue