fix(observer): lowercased event name before translation

Fixes #99
pull/100/head
Sergey Stotskiy 7 years ago
parent 57887ea0a1
commit 34561d8d03

@ -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