Hi,
I was just wondering if someone could help me solve a problem I am having with redux. I have posted a pen as best as I can with the code in it here:
http://codepen.io/tomhanson1985/pen/oYveQE?editors=1010
Apologies if it is messy but I am pretty new to Redux!
Just to clarify what I am trying to do:
When a link is clicked or a component loads it dispatches an action passing the page slug to it. I use that page slug to query a rest api(wordpress one) and then when the data comes back I want to store it in the store using the page slug as the name of the property.
i.e
about-us : /*about us page data */
My question is this: The reducer I have put in that pen works exactly how I thought it would but it mutates the state which everything I read tells me is a big no no! I’ve tried refactoring it with no joy as of yet!
Hopefully that all makes sense!