Skip to content

Nested store modules #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
uedaeita opened this issue Sep 2, 2020 · 2 comments
Open

Nested store modules #21

uedaeita opened this issue Sep 2, 2020 · 2 comments

Comments

@uedaeita
Copy link

uedaeita commented Sep 2, 2020

It seems like using nested store modules does not work as expected. How can I utilize vuex-composition-helpers to do such as following? Please let me know if I missed out on anything!

// Some SFC
import { useNamespacedState, useNamespacedActions } from 'vuex-composition-helpers/dist';

export default defineComponent({
  setup() {
    const { someState } = useNamespacedState('module/submodule', ['someState']);

    return {}
});
// Some store
export default {
  namespaced: true,

  modules: {
    namespaced: true,
    module: {
      namespaced: true,
      submodule: {
        state: {
          someState: 'foo'
        }
      }
    }
  }
};
@davidmeirlevy
Copy link
Contributor

It should work as you mentioned.
If not, let us fix this issue (or you can try to fix it, or add a test suite that tests this case).

@wolfsblu
Copy link
Contributor

I've run into the same problem and submitted my attempt to fix it in PR #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants