Skip to content
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

Re-usability of vuex store using typescript #5908

Closed
jinash opened this issue Jun 10, 2019 · 1 comment
Closed

Re-usability of vuex store using typescript #5908

jinash opened this issue Jun 10, 2019 · 1 comment
Labels

Comments

@jinash
Copy link

jinash commented Jun 10, 2019

How can I implement generic store which can be reusable? for example:

interface BaseState {
list: []
}

interface ChildState extends BaseState {}

export default class BaseActions implements ActionTree<BaseState, BaseState>{
add(context:ActionContext, payload:BaseState){
context.commit('ADD', palyload)
}
}

export default class ChildActions extends BaseAction{
.. need to add actions only if one not available in parent class
}

or if can I create generic store which contains all (actions, mutations, getters, state)

This question is available on Nuxt community (#c9337)
@ghost ghost closed this as completed Jun 10, 2019
@ghost ghost added the cmty:question label Jun 10, 2019
@ghost
Copy link

ghost commented Jun 10, 2019

This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c9337.

@jinash jinash changed the title Re-usability of vuex actions and mutations using typescript Re-usability of vuex store using typescript Jun 10, 2019
@danielroe danielroe added the 2.x label Jan 18, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants