2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-06-20 05:50:35 +03:00

Add namespaced mutation for Vuex

This commit is contained in:
Michgeek
2017-03-19 23:30:23 +11:00
parent 51f5a95014
commit 7abefc3bad
2 changed files with 7 additions and 5 deletions
+6 -2
View File
@@ -41,8 +41,12 @@ export default class{
if(type.split('_')[0].toUpperCase() === 'SOCKET'){
if(this.store._mutations[type])
this.store.commit(type, payload)
for (let namespaced in this.store._mutations) {
let mutation = namespaced.split('/').pop()
if (mutation === type)
this.store.commit(namespaced, payload)
}
}