So, right now I have a landing page that fetches all of my data through an action.
When the user clicks to view a singular item from the landing page (items -> items/:id), should the page component dispatch an action called findItemByID, the reducer do the finding and set a {currentItem: id} object on the root store? You'd essentially have something like:
items: { "items": [], "currentItem": 10, "fetching": false, "fetched": true, "errors": null }How do you handle this flow in Redux? Am I doing it all wrong?
Or, I could also use some local state on the singular item component container where on mount it gets the id from the router and then uses lodash to do something like
_.find(this.props.items, (item) => {item.id === currentID})and set the result tothis.state.item. Local state isn't a bad thing, right?