Open Joebayld opened 3 years ago
Well, you can just unregister the module using the store, e.g.
// register.ts
import store from "./store"
@Module
class MyModule extends VuexModule {
// ...
}
const myModule = new MyModule({ name: "myModule", store })
// unregister.ts
import store from "./store"
store.unregisterModule("myModule")
I'm looking to use this to dynamically add / remove Vuex stores. Has anyone come across this?
Vuex has a
unregisterModule
function for this purpose - just wondering the best way to use it with this library.https://vuex.vuejs.org/guide/modules.html#dynamic-module-registration
Thanks!