2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-05-17 05:09:39 +03:00

Merge pull request #39 from michgeek/master

Add namespaced mutation for Vuex
This commit is contained in:
Metin Seylan
2017-03-19 20:53:46 +02:00
committed by GitHub
2 changed files with 7 additions and 5 deletions
+1 -3
View File
File diff suppressed because one or more lines are too long
+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)
}
}