I am working on an app which has a list of orders on a view. Order status -received, preparing, ready, complete- gets updated real time via another app. We are using graphql subscription, which order status gets updated, and in my reducer I catch it updated order, and find it in orders array, update with the new order.
What I couldn't figure out is, UI doesn't get updated.
If a new order is created and when I append it, it gets updated.
If an order is completed, and when I remove from array, it gets updated.
However if order is not needed to append or remove, just update then nothing happens even order is updated in the array in the state. I need to leave the page, and come back again to see updated.
I even copied the order to be updated to update its status after updated order comes from catchtoeffect has different id(UUID),
Still didn't work.
I even tried remove at index, and insert at index, still didnt get updated.
What is the best approach for this scenario?
I tried ForEachStore, binding, after 3 days, I started to confuse myself.
Which example in the SCA case studies help me?