mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-06-11 23:12:25 +03:00
Merge pull request #59 from OmgImAlexis/master
add support for custom mutation name
This commit is contained in:
+6
-1
@@ -21,6 +21,7 @@ export default class {
|
||||
this.connect(connectionUrl, opts)
|
||||
|
||||
if (opts.store) { this.store = opts.store }
|
||||
if (opts.mutations) { this.mutations = opts.mutations }
|
||||
this.onEvent()
|
||||
}
|
||||
|
||||
@@ -91,6 +92,10 @@ export default class {
|
||||
target = [msg.namespace || '', msg.action].filter((e) => !!e).join('/')
|
||||
}
|
||||
}
|
||||
this.store[method](target, msg)
|
||||
if (this.mutations) {
|
||||
this.store[this.mutations[method] || method](target, msg)
|
||||
} else {
|
||||
this.store[method](target, msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user