When i add a new item to cart, this number should increment in real time. Right now i have to refresh the page in order for the cart item count to increase. also the count should be the sum of all qtys for all items in the cart, not just the count of items.
in order to accomplish realtime updates of this number, you can play around with router.refresh if this doesnt affect the notifications workflow.
option 2 is to also use a global context provider like react context, then update the context whenever the updateCartItem or removeCartItem actions are called. this will not affect the flow of notifications.
When i add a new item to cart, this number should increment in real time. Right now i have to refresh the page in order for the cart item count to increase. also the count should be the sum of all qtys for all items in the cart, not just the count of items.
in order to accomplish realtime updates of this number, you can play around with router.refresh if this doesnt affect the notifications workflow.
option 2 is to also use a global context provider like react context, then update the context whenever the updateCartItem or removeCartItem actions are called. this will not affect the flow of notifications.