Skip to content

Q: Is it correct createDirectStore with "empty" (only modules) configuration? #26

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

Closed
viT-1 opened this issue Jan 17, 2020 · 3 comments
Closed

Comments

@viT-1
Copy link

viT-1 commented Jan 17, 2020

Can I use store from config:

const storeConf = {
	state: {},
	actions: {},
	getters: {},
	mutations: {},
	modules: modulesConf,
} as const;

Vue.use(Vuex);
export const { store, moduleActionContext } = createDirectStore(storeConf);

or I should use getters: createGetters<{}>(), createActions, etc?

@viT-1
Copy link
Author

viT-1 commented Jan 17, 2020

Related: #25 (comment)

@viT-1 viT-1 changed the title Q: Is it correct ot createDirectStore empty configuration? Q: Is it correct createDirectStore with "empty" (only module) configuration? Jan 17, 2020
@viT-1 viT-1 changed the title Q: Is it correct createDirectStore with "empty" (only module) configuration? Q: Is it correct createDirectStore with "empty" (only modules) configuration? Jan 17, 2020
@paleo
Copy link
Collaborator

paleo commented Jan 17, 2020

or I should use getters: createGetters<{}>(), createActions, etc?

The following helpers do nothing:

  • createGetters
  • createMutations
  • createActions

They are implemented with: (arg) => arg.

So yes you can directly implement the JS object the old way.

@viT-1 viT-1 closed this as completed Jan 17, 2020
@viT-1
Copy link
Author

viT-1 commented Jan 17, 2020

Yes, I thought so, but trying to fix jest tests all ways I can.

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

2 participants