Merge pull request #118 from stalniy/fix/actions

fix(actions): properly transform action to store action
pull/75/head^2
Metin Seylan 7 years ago committed by GitHub
commit 9e6a586423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,9 +52,10 @@ export default class {
if (!action.startsWith('socket_')) continue
let camelcased = 'socket_' + event.toLowerCase()
.replace('SOCKET_', '')
.replace(/[\W\s_]+(\w)/g, (match, p1) => p1.toUpperCase())
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…
Cancel
Save