In my application, a user has multiple.. let's say 'dogs'. The currently selected dog appears in the header, and can be changed through the header's dropdown menu. Upon selecting their new dog, it marks it as primary: true on the backend, and I make the corresponding header UI update. From that point onwards, all requests to the backend return results for the primary dog.
I have a Layout.jsx component that looks like this:
<Header />
<div>
{this.props.children}
</div>
In this.props.children, I render an index page for multiple different resources, i.e an example of a child component might be TreatsContainer where a network request is made in componentDidMount to /treats, and the results are rendered within my layout.
The problem I am facing is that when a user changes their dog in the header component, I'd like the other components to re-run the same network request that they are making in componentDidMount, so that the newly selected dog's data is shown. I have Redux implemented in a couple places within the application, but I'd like to not store all data in the global state tree, because there's no limit to how many resources the user can create. What I mean by this is I don't want all data from /treats, /toys, /foods, etc. in a bunch of arrays. What would be a good approach to handling this situation?