getters.js 249 B

1234567891011
  1. export const count = state => state.count
  2. const limit = 5
  3. export const recentHistory = state => {
  4. const end = state.history.length
  5. const begin = end - limit < 0 ? 0 : end - limit
  6. return state.history
  7. .slice(begin, end)
  8. .join(', ')
  9. }