I couldn't find the answer to this question. Not sure if this is just obvious and I'm overthinking or I tried asking the wrong question.
Basically, I'm trying to build an app with React (first project) where I get League of Legends match history of a given player (e.g. 300 matches from entire year - or maybe even all of their matches ever). Each match obviously contains some data about it (duration etc.)
Now, I want to loop through those matches and prepare some data to be used in different parts of the app. For example, I want to count how many games the player played on different champions, what were their stats, win ratio etc. I'm not sure where I should do this data processing. Should it be right after I get data back from API? Or maybe only when I need to render a component with those champions summary? - second one makes less sense to me as let's say I'll have to go through those 300 matches again in some different part of the app to process some other piece of information. On the other hand, I feel like gathering all this data upfront and saving it into state, just in case, is an overkill.
Please, give me some directions.