-
-
Notifications
You must be signed in to change notification settings - Fork 170
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extends VuexModule fails #30
Comments
BTW, |
The rootState can be added to the type defintion. Double inheritance is something I didn't keep in mind when working this out. I neeed to change how the decorator works for that to happen, I'll take a look at this. |
@championswimmer or maybe do you have another suggestion to implement shared variables between my components that would fit better the Vuex pattern? I could create a "rootModule" that I would inject in another module through
|
mixin-type usage in vuex modules were never part of the design, even in default js-based vuex usage. if you want common features, create a separate common module for that maybe |
I've just implemented a module and I need to declare variables outside (and before) the module definiton since all the
I'm not confident about the cleanliness of this way of doing but... it works 馃槃 Thank you for your answers, |
Hi @championswimmer 馃槂
I'm putting logger and api client instances in my global state because I want to use them in almost all my store modules.
To avoid using each time
this.rootState.logger.debug('blabla')
I'm trying to make all my modules herited from aEnrichedVuexModule
as follow:And my modules are defined with the following:
My TypeScript "linter" detects that
this.$api
andthis.$log
exist due to the inheritance but at runtimethis.$api
andthis.$log
are not defined (while I can reach them throughthis.rootState.XXX
). Same for thetest()
function.Since I'm using dynamic modules and that some stuff is made with decorators by your package, do you know what could cause this trouble please?
Thank you,
The text was updated successfully, but these errors were encountered: