-
-
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I use a constructor in a module? #105
Comments
Modules are not supposed to be constructed. Use getModule() to fetch a
module object.
…On Mon 18 Mar, 2019, 1:13 AM Magnus Johansson, ***@***.***> wrote:
I need to do some initialization work whenever the module is constructed.
But when I add the super(); call, it expects a module parameter.
What should I pass in there?
@Moduleexport default class RealTime extends VuexModule {
private playersOnline!: [];
constructor() {
super();
}
get getPlayersOnline() {
return this.playersOnline;
}
};
constructor VuexModule<ThisType, any>(module: Module<ThisType, any>):
VuexModule<ThisType, any>
Expected 1 arguments, but got 0.ts(2554)
vuexmodule.d.ts(16, 17): An argument for 'module' was not provided.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#105>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQ_yiXDwsGJZAMc_22MJgfVjqcaGYGDks5vXpr3gaJpZM4b4mOf>
.
|
This prevents me from using DI (inversify.js) with modules. |
It's wonderfull thing but look - if you want to inject something (this real cool to inject service to module and use it in MutationAction) - you can't |
And if you need to get a module, but for some reason can't because of an unresolved issue #266 ? I need to get my authStore, but can't use |
This makes me sad. |
What if we want to use a store variable of type
Accessing the |
I need to do some initialization work whenever the module is constructed.
But when I add the super(); call, it expects a module parameter.
What should I pass in there?
The text was updated successfully, but these errors were encountered: