mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Added checks
This commit is contained in:
parent
6ac84d4fbd
commit
8efee08e34
1 changed files with 14 additions and 9 deletions
|
@ -90,7 +90,7 @@ export default class EventEmitter{
|
||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
dispatchStore(event, args){
|
dispatchStore(event, args){
|
||||||
if(this.store){
|
if(this.store) {
|
||||||
|
|
||||||
this.dispatchModule('', this.store._modules.root, event, args)
|
this.dispatchModule('', this.store._modules.root, event, args)
|
||||||
|
|
||||||
|
@ -99,6 +99,9 @@ export default class EventEmitter{
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatchModule(path, mod, event, args){
|
dispatchModule(path, mod, event, args){
|
||||||
|
|
||||||
|
if(mod._rawModule.actions) {
|
||||||
|
|
||||||
const action_prefixed_event = this.actionPrefix + event;
|
const action_prefixed_event = this.actionPrefix + event;
|
||||||
|
|
||||||
// If the action exists in the module dispatch it
|
// If the action exists in the module dispatch it
|
||||||
|
@ -111,7 +114,9 @@ export default class EventEmitter{
|
||||||
this.store.dispatch(fullKey, args);
|
this.store.dispatch(fullKey, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.mutationPrefix){
|
}
|
||||||
|
|
||||||
|
if(this.mutationPrefix && mod._rawModule.mutations) {
|
||||||
|
|
||||||
const mutation_prefixed_event = this.mutationPrefix + event;
|
const mutation_prefixed_event = this.mutationPrefix + event;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue