mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Merge pull request #118 from stalniy/fix/actions
fix(actions): properly transform action to store action
This commit is contained in:
commit
9e6a586423
1 changed files with 4 additions and 3 deletions
|
@ -52,8 +52,9 @@ export default class {
|
||||||
|
|
||||||
if (!action.startsWith('socket_')) continue
|
if (!action.startsWith('socket_')) continue
|
||||||
|
|
||||||
let camelcased = 'socket_' + event.toLowerCase()
|
let camelcased = 'socket_'+event
|
||||||
.replace('SOCKET_', '')
|
.replace('SOCKET_', '')
|
||||||
|
.toLowerCase()
|
||||||
.replace(/[\W\s_]+(\w)/g, (match, p1) => p1.toUpperCase())
|
.replace(/[\W\s_]+(\w)/g, (match, p1) => p1.toUpperCase())
|
||||||
|
|
||||||
if (action === camelcased) this.store.dispatch(namespaced, payload)
|
if (action === camelcased) this.store.dispatch(namespaced, payload)
|
||||||
|
|
Loading…
Add table
Reference in a new issue