-
Notifications
You must be signed in to change notification settings - Fork 4
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
Usage with nuxt.js #6
Comments
|
If there is anything I can contribute, please let me know. |
Resolved with v1.0.2
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all: Thank you for this library! I also tried to make vuex typesafe and must admit that I really like your approach - maybe even better than mine!
We are using vuex a lot in combination with nuxt.ts and I wanted to share some thoughts about using your library with nuxt.js:
1. Using the interfaces with vuex modules mode:
Maybe you could declare a shorter type for
Resolvable<StateInputFor<S>>
to make it more readable.2. ThisType of ActionTree should be
Store<S>
Vuex actions are bound to the store. Therefore the
ThisType
in anActionHandler
isStore<S>
. Currently you have to merge the type withThisType<Store<M>>
to make accessing injections like$axios
work.Maybe you could add this to your declaration to make it work out of the box.
3. Workaround for namespaced modules:
While we are waiting for microsoft/TypeScript#12754 to be implemented in Typescript, one could use the following workaround:
While this is nothing special it might help somebody to use namespace modules without big modifications.
4. Subsequent declarations
See my comment in #5
I hope my comments are understandable and you can use them to further improve your great library.
Thank you!
The text was updated successfully, but these errors were encountered: