Currently, I'm using vuex-module-decorators and looking for an alternative that supports dynamically managing multiple instances of same module definition. This is inherently impossible with vuex-module-decorators which requires module name to be specified with the @Module decorator in order to create accessor objects. Now that I found vuex-class-modules can do that (nice!), I found a couple of crucial registerModule features are not exposed by vuex-class-modules and wanted to leave a feedback.
From vuex docs:
registerModule(path: string | Array, module: Module, options?: Object)
Register a dynamic module.
options can have preserveState: true that allows to preserve the previous state. Useful with Server Side Rendering.
Here, following features are missing from the VuexClassModuleFactory of vuex-class-modules:
ability to pass Array<string> as the module path to register nested modules
ability to pass {preserveState: true} as an option
I'm especially looking for the latter because we use vuex-persist plugin and need to specify preserveState for each module that are previously persisted.
This is a feature request.
Currently, I'm using
vuex-module-decorators
and looking for an alternative that supports dynamically managing multiple instances of same module definition. This is inherently impossible withvuex-module-decorators
which requires module name to be specified with the@Module
decorator in order to create accessor objects. Now that I foundvuex-class-modules
can do that (nice!), I found a couple of crucial registerModule features are not exposed byvuex-class-modules
and wanted to leave a feedback.From vuex docs:
https://vuex.vuejs.org/api/#registermodule https://vuex.vuejs.org/guide/modules.html#dynamic-module-registration
Here, following features are missing from the VuexClassModuleFactory of
vuex-class-modules
:Array<string>
as the module path to register nested modules{preserveState: true}
as an optionI'm especially looking for the latter because we use
vuex-persist
plugin and need to specifypreserveState
for each module that are previously persisted.Thanks!