i'm new into React and I have a problem that I don't know how to solve - after loading page I'm storing pretty big data in Redux toolkit - an array of objects. Each object has its own id.
Next, after some user action, i'm getting the object ID and I need to get data from it - I think that every user click, mapping the whole array and find the item with correct ID isn't the most effective way. Is it possible to create something that would give me the info about the object stored in Redux by passing it's ID without mapping whole array? Something like -
getDataFromId(id) - and it would return object's data.
What is the most effective way to deal with problems like that?