Skip to content

Commit 41a5cbd

Browse files
aduthktsn
authored andcommitted
Clarify getter cache behavior (#831)
1 parent 82efdd0 commit 41a5cbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/en/getters.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ computed: {
1212

1313
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.
1414

15-
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:
15+
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.
16+
17+
Getters will receive the state as their 1st argument:
1618

1719
``` js
1820
const store = new Vuex.Store({

0 commit comments

Comments
 (0)