Vuex-module-decorators: How to call another module action from a module?

Created on 24 Sep 2018  路  5Comments  路  Source: championswimmer/vuex-module-decorators

Say I have 2 modules A and B. How can I call an action of module B from an action of module A?
It would be easy if I can access context though.

Most helpful comment

@erathorus I can't see any example in that repo of one module action calling another module action - just references to this.context. Is that what you are referring to?

I am expecting to see something like this:

MODULE A
@Action(...)
public async myaction(): Promise<void> {
    foo = getModule(ModuleB, store);
    await foo.asyncAction();
}

All 5 comments

This is resolved in 0.8.

Can you provide an example please?

@erathorus , can you provide a working example please :) ?

@erathorus I can't see any example in that repo of one module action calling another module action - just references to this.context. Is that what you are referring to?

I am expecting to see something like this:

MODULE A
@Action(...)
public async myaction(): Promise<void> {
    foo = getModule(ModuleB, store);
    await foo.asyncAction();
}
Was this page helpful?
0 / 5 - 0 ratings