I need input from someone experienced with React+Flux+async API requests
pattern. What will be the better way to cache api response in the following situation:
I have 3 lists pages of articles each with corresponding API endpoint to fetch data.
each article has details page UI but there's no articleById endpoint, so I just
.find
necessary article by id in the fetched arrayI want to make only 1 request on the list and cache it, so when I go to the details page from the list or return back to the list there will be no API requests.
When I switch to another list I should make the request and cache it.
I'm wondering should I cache the response in WebAPIUtils service which makes actual requests?
Or is it better to hack container component (which is the same for all 3 lists) in a way to know whether it should fire action which starts API request?
Thanks!