vuex-module
Module that turns vuex modules into poetry.
Key features
- Auto namespacing for mutations, actions and getters
- Mappers for namespaced components
- Localized state and commit available via this
- Nicer way of registering mutations, actions and getters
- Optional global registration for getters
Example
const state getter action mutation build = 'products' ;
Getters, actions and mutations will be prefixed with with
module name resulting with: products/all
, and
products/fetch
methods.
You can then use VuexModule mappers to map namespaced methods to your components.
computed: methods:
Inside mutations state is available via this
. This simplifies function
declaration and makes code more readable. Same goes for getters and
actions (context, commit, rootState, rootGetters).
MIT