typescript icon indicating copy to clipboard operation
typescript copied to clipboard

Poor typescript examples

Open Pacheco95 opened this issue 4 years ago • 6 comments

I'm trying to learn how to do vuex things in a typescript way, but having too much pain to find useful guides and examples. The examples provided in https://github.com/nuxt/typescript/tree/master/examples is too poor and not useful. Can you make some effort to improve the examples with real world usage?

The best guide I have found was this article https://blog.logrocket.com/how-to-set-up-and-code-nuxt-js-apps-fully-in-typescript/

Pacheco95 avatar Dec 18 '20 14:12 Pacheco95

Thank you for your feedback @Pacheco95

If you have a better example, feel free to open a pull request, contributions and new contributors are welcome :blush:

atinux avatar Dec 18 '20 14:12 atinux

Hi @Pacheco95 I want to add this example (https://codesandbox.io/s/nuxt-eshop-ts-vg6lg) into the documentation. What do you think ? Feedbacks are welcome @Atinux @danielroe ❤️

Geminii avatar Dec 27 '20 11:12 Geminii

Hi @Pacheco95 I want to add this example (https://codesandbox.io/s/nuxt-eshop-ts-vg6lg) into the documentation. What do you think ? Feedbacks are welcome @Atinux @danielroe ❤️

I'll check it out!

Pacheco95 avatar Dec 27 '20 16:12 Pacheco95

@Geminii it is a very good example. Will be nice to start a PR with it.

Pacheco95 avatar Dec 27 '20 20:12 Pacheco95

I'm not an expert with Nuxt and Typescript, and in my opinion guide, examples, and explanation of using Vuex with Nuxt and Typescript are just very very very confusing and disconnected. I dread the fact I tried in the first place. Not sure if after two years since this issue was open, other developers faced the same issues, but I did.

If there's anything I can do to help, please let me know, so far it was just a world of pain.

raphaelarias avatar Jul 04 '22 18:07 raphaelarias

The tricky piece is that vuex wasn't built with typing in mind. You can use Pinia (or if you need to stay with vuex, feel free to try my own project https://typed-vuex.roe.dev/ which was created to address this issue in a different way).

danielroe avatar Jul 04 '22 18:07 danielroe