direct-vuex icon indicating copy to clipboard operation
direct-vuex copied to clipboard

Typing modules added by plugin

Open tobiasbeck opened this issue 4 years ago • 0 comments

Hello I'm using the feathers-vuex Plugin for Vuex. To make it short how it works is that you define multiple plugins for your backend services and these plugins register namespaced modules which can communicate with the feathers backend service. However since these modules are generated and registered inside a Plugin, I have no Idea how to enable them inside the direct-vuex store and also generate a Typing for them. I defined my store the following way:

export const {
  store,
  rootActionContext,
  moduleActionContext,
  rootGetterContext,
  moduleGetterContext,
} = createDirectStore({
  strict: debug,
  state: {
    empty: true,
  },
  mutations,
  actions,
  modules: {
    desktop,
    audio,
    connectionStatus,
  },
  plugins: [
    ...servicePlugins,
    auth,
  ],
});

servicePlugins is a list of feathers-vuex plugins, which each register a namespaced module containing getters by using store.registerModule, mutations and actions. My custom defined modules which are defined by using direct-vuex defineModule method are mapped correctly, however the modules defined by the plugins are missing in direct-vuex getters and actions. Is there a way to add these to direct-feathers to be able to have them types?

tobiasbeck avatar Apr 29 '20 15:04 tobiasbeck