getItemsCount.js 213 B

123456789
  1. export function getItemsCount(state) {
  2. if (state.collections.length === 0) {
  3. return 0;
  4. }
  5. return state.collections.reduce(function (sum, collection) {
  6. return sum + collection.items.length;
  7. }, 0);
  8. }