mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Adds support for mutations with '.', '-', ' '.
Mutations now support events similar to actions and matches example in README. e.g. emit('user-message', ...); -> SOCKET_USER_MESSAGE
This commit is contained in:
parent
d3c8d11f9e
commit
cba4d743b3
1 changed files with 1 additions and 1 deletions
|
@ -44,7 +44,7 @@ export default class{
|
||||||
|
|
||||||
for(let namespaced in this.store._mutations) {
|
for(let namespaced in this.store._mutations) {
|
||||||
let mutation = namespaced.split('/').pop()
|
let mutation = namespaced.split('/').pop()
|
||||||
if(mutation === event.toUpperCase()) this.store.commit(namespaced, payload)
|
if(mutation === event.replace(/\W/g, '_').toUpperCase()) this.store.commit(namespaced, payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
for(let namespaced in this.store._actions) {
|
for(let namespaced in this.store._actions) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue