I have a website that is built on react. I have a form where a user can add a single value to a group, but want to change this component so that the user can add up to 10 values to the group at once. Is it ok to just loop over the user input and call the backend API 10 times, or should i create a batch update API? Additionally, does react have a way I can parallel call the API, or do I have to use a loop?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Go with the batch API approach. It's more efficient, provides better user experience, and is easier to maintain. The parallel API calls approach should only be used if you absolutely cannot modify your backend.