Merge pull request #100 from stalniy/master

fix(observer): lowercased event name before translation
pull/112/head
Metin Seylan 7 years ago committed by GitHub
commit 1e2702b912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,9 +52,9 @@ export default class{
if(!action.startsWith('socket_')) continue
let camelcased = 'socket_'+event
let camelcased = 'socket_'+event.toLowerCase()
.replace('SOCKET_', '')
.replace(/^([A-Z])|[\W\s_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase())
.replace(/[\W\s_]+(\w)/g, (match, p1) => p1.toUpperCase())
if(action === camelcased) this.store.dispatch(namespaced, payload)
}

Loading…
Cancel
Save