|
@@ -12,7 +12,9 @@ computed: {
|
|
|
|
|
|
If more than one component needs to make use of this, we have to either duplicate the function, or extract it into a shared helper and import it in multiple places - both are less than ideal.
|
|
|
|
|
|
-Vuex allows us to define "getters" in the store (think of them as computed properties for stores). Getters will receive the state as their 1st argument:
|
|
|
+Vuex allows us to define "getters" in the store. You can think of them as computed properties for stores. Like computed properties, a getter's result is cached based on its dependencies, and will only re-evaluate when some of its dependencies have changed.
|
|
|
+
|
|
|
+Getters will receive the state as their 1st argument:
|
|
|
|
|
|
``` js
|
|
|
const store = new Vuex.Store({
|