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