Vuex getters behave a lot like Mongoose getters: they’re special properties that are computed from other properties when you access them . For example, suppose your store contains a user’s firstName and lastName . You can write a getter that returns the user’s fullName .
Read moreHow do you access getters in Vuex?
We implement our getter function in the Vuex store and call it in all the components we need it.
Read moreWhy should I use getters in Vuex?
Here are a few things that are great about getters: They are easily accessible inside both components and Vuex actions ; They cache data and smartly update themselves when the state changes; They can return functions, so that it’s possible to pass additional arguments to calculate data based on them.
Read more