Struggles

Struggling and finding a way

I didn’t get much coding done today, my mind was unfocus and somewhere else. I am having issues implementing rendering data fetched from an API call. I am hung up on doing it correctly, I think my next approach will just to implement poorly and see what happens.

Issue Do I just I just create a generic fetch function then input the endpoint into that function or do I hard code the endpoints into each function?

Example I want to fetch the next 20 pokemon by creating an eventlistener looking for a button click then rendering out that data, but I also want to display the first 20 on the page on load, I would also like to create an eventlistener to search for pokemon within the JSON result. Do I create one generic fetch function or do I store the new URLs in a const at the start of the app?