Skip to content

Retrieve module context from store instance #1561

Open
@mspiderv

Description

@mspiderv

What problem does this feature solve?

This feature adds the ability to retrieve the store module context directly from root store instance.

What does the proposed API look like?

Let's suppose, that store variable is my Vuex (root) store instance.

I solve this problem with the following code:

let subModuleContext = store._modulesNamespaceMap['subModuleName/'].context

It would be nice to write

let subModuleContext = store.getContext('subModuleName')

Then, I can write subModuleContext.dispatch('someAction') instead of store.dispatch('subModuleName/someAction')

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions