React store getters

aren’t store getters supose to act like selectors in redux ?
once i use useStore on my getters, the first time it returnes my desired results but after the state changes it returns the state and not what i wrote on getter
this is my getter code :

ordersReport({ state }) {
  let ordersReport = {
    totalOrders: 0,
    completed: 0,
    pending: 0,
    processing: 0

  state.ordersReport.forEach(orderReport => {
    switch (orderReport.slug) {
      case 'completed':
        ordersReport.completed +=;
        ordersReport.totalOrders +=;
      case 'pending':
        ordersReport.pending +=;
        ordersReport.totalOrders +=;
      case 'processing':
        ordersReport.processing +=;
        ordersReport.totalOrders +=;
        ordersReport.totalOrders +=;

  return ordersReport

and this is how i use it :

const ordersReport = useStore(‘ordersReport’);

the first time it behaves correctly but when state changes it only shows the state.ordersReport even tho i didnt return it in getter …

help please , any suggestion would be helpfull

Seems like issue on F7 side. Already fixed in so will be fixed in next update

1 Like