Open tmarqxx opened 4 years ago
Hello,
I had very similar problem. Each of the Vuex store modules expect the parent module as argument.
Simply in AbstractStore
define constructor like:
constructor(module: Mod<ThisType<any>, any>, endpoint: string) {
super(module);
this.endpoint = endpoint
}
and in UsersStore
constructor(module: Mod<ThisType<any>, any>) {
super(module, endpoint);
}
Let us know if it work.
Hi there.
I'm trying to set up my modules to extend an
AbstractStore
class that implements basic actions and mutations for simple CRUD operations. Whereas the children ofAbstractStore
implement their respective state, getters and any other actions/mutations that are unique to them.To implement this I'm passing an endpoint string to its constructor, which is then used in the HTTP requests. Here's a rough example of how I'm trying to implement this:
My issue is that I'm not sure how to call the
VuexModule
constructor in theAbstractStore
constructor. When simply callingsuper()
, my editor shows an error saying:So what should I pass to
super
to make this work? Can this implementation even work as I want it to? Would love some insight, thanks!