I am working on a Single page application with React, and I have lot of drop downs in the page. These drop downs contains multiple options, and I don't want to hard-code options in java script. Instead i need to get the options from API.
Is there any pattern used in such scenarios. I think of multiple ways
- single API endpoint which returns all such metadata information like drop down options, menu options and even resource strings. This API will be called initial page load.
- Individual APIs for every drop down or page. This API will be called when ever user navigates to new page in client.
Aucun commentaire:
Enregistrer un commentaire