Answer the question
In order to leave comments, you need to log in
How to save dynamic store module (state, action, getter, mutation) manually?
https://github.com/gertqin/vuex-class-modules/issues/72
Here is a package, it solves the problems that I had in a large monolith with a large store, namely
1 - reusability (inheritance and extension, functionality is difficult to debug )
2 - reduction of the boiler plate (use of vuex-class and all its ensuing inability to create a dynamic mixin, which forces you to declare dozens of getters and actions for each template)
3 - improved support (readability, strong typing, easier to debug)
4 - dynamic modules, can be attributed to point 3, when you have 50+ modules in the repository and you open the debug bar, it will take years until you find the desired state and its getter + the security can suffer in theory. Admin modules will be initialized only on the admin page.
5 - purer mutations, now they exclusively mutate the state and do not perform additional functions such as deep search where and what data to mutate, everything happens in the action, the getter is called there, the data is found, a new object is collected, the mutator is called to replace.
of the most noticeable minuses
1 - you can no longer merge several modules into one, lack of multi-inheritance
export default () => _.merge({}, module_1, module_2, module_3, module_4....}) ;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question