I have a table with bunch of user ID. I want to take those user ID and make api request and get their full name. The table will contain duplicate IDs. What is the most elegant/proper way to so I don't bash the database with 100s or 1000s of API calls for same user ID?
Should I store all the USER ID into an array and filter out the duplicates and make the API call? But even if I did filter out duplicates I still have 100s or 1000s of unique IP it would still bash the server with requests. I was looking at share() but from my little understanding of share() is for api with multiple information on one api call and that api can be reused for different info correct? for example: api/{2} would respond data: { name: jon, id: 2, job: cashier }, so one async call can user the same api for name in one instance and job for another instance on that same api call correct?
shareReplay is also regards to the data returned correct?
Maybe I'm not understanding RxJS correctly.
What i'm trying to get at how can i properly/elegantly make unique API calls without redundancy and limit bashing possibly 1000s of calls back to back.
thanks in advance for any suggestions and help.
edit: i forgot to mention that i want to take the full name and put it back into the original api and mergemap??