Update Observer.js

Added namespaced mutations support
This commit is contained in:
Nicolas Bourasseau 2017-11-07 08:38:18 +01:00 committed by GitHub
parent 57887ea0a1
commit 22d066fa88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,7 +43,7 @@ export default class{
if(!event.startsWith('SOCKET_')) return
for(let namespaced in this.store._mutations) {
let mutation = namespaced.split('/').pop()
let mutation = ('SOCKET_' + namespaced.replace('SOCKET_','')).toUpperCase();
if(mutation === event.toUpperCase()) this.store.commit(namespaced, payload)
}