Skip to content

Conversation

AndrewBogdanovTSS
Copy link

Since TS primary feature is typings support I think it would be great to showcase how Vuex store can be properly typed inside a template

@AndrewBogdanovTSS
Copy link
Author

@qm3ster could you review?

@qm3ster qm3ster changed the title Impowing Vuex Store typings Improving Vuex Store typings Feb 12, 2018
qm3ster
qm3ster previously approved these changes Feb 12, 2018
@Koc
Copy link

Koc commented Mar 17, 2019

what about adopt decorators for store https://github.com/championswimmer/vuex-module-decorators ? It has very friendly syntax and strong typing/autocomplete inside IDE.

@brokenthorn
Copy link

brokenthorn commented Apr 24, 2020

what about adopt decorators for store https://github.com/championswimmer/vuex-module-decorators ? It has very friendly syntax and strong typing/autocomplete inside IDE.

Vue developers themselves decided to not officially support classes and decorators, decorators being still unstable API in TS, if I'm not mistaken. Also, there's no reason why the object API wouldn't provide autocomplete inside IDE, or wouldn't be strongly typed. I also prefer the purely functional and object literal approach...

@atinux
Copy link
Contributor

atinux commented Oct 23, 2020

Seems a bit old now, is it still relevant?

@hmsk
Copy link
Member

hmsk commented Oct 24, 2020

@atinux I was going to close this PR and another issue #37 when the new Vuex comes and this template could deliver an appropriate approach for typing of Vuex.
https://github.com/nuxt-community/typescript-template/blob/main/README.md#faq

The current template is not providing any appropriate approach to give consistent typedefs between pages and store. And I'm expecting the next Vuex gives an official-ish way for that.

@atinux
Copy link
Contributor

atinux commented Nov 2, 2020

Alright, letting you handle it @hmsk thank you!

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

Successfully merging this pull request may close these issues.

7 participants