Open Chris2011 opened 4 years ago
I have a related question similar to @Chris2011's. Vanilla Vuex mutations take state
as a parameter. This is great for testing because I can mock the state that will be used in the mutation.
When using a class based approach, a constructor would be the way to go, I suppose. How do we do this using this library?
Hi,
I use vuex with TS and your package to use the decorators and the getModule method.
Now I have a store with a ctor, which needs 2 more modules as dependencies. Atm I do this in the ctor of my module
The problem here is while testing, I need to inject them in another way, prefered would be via constructor. Is there a way, getModule can handle this or how do I do this?
I prefer this
constructor(module: Mod<ThisType<{}>, any>, sessionStore: SessionStore, notificationStore: NotificationStore) {
Cheers
Chris