We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3909af0 commit 4b038d7Copy full SHA for 4b038d7
examples/counter-hot/store/getters.js
@@ -1,11 +1,7 @@
1
export const count = state => state.count
2
3
-const limit = 5
4
-
5
export const recentHistory = state => {
6
- const end = state.history.length
7
- const begin = end - limit < 0 ? 0 : end - limit
8
return state.history
9
- .slice(begin, end)
+ .slice(-5)
10
.join(', ')
11
}
0 commit comments