Time tracking dashboard with vanilla JS

Solution retrospective
I have a question. In this challenge, for fetching the data from a JSON file, I used classic XML. Firstly I fetch the data, store it in a variable and change the HTML from what button is clicked. This is okay as I don't need to wait to get the data back(I assume users won't click the button as soon as the page is loaded). I'm also aware it takes time to get back the data from the server. The question is "Should I fetch the data only when a button is clicked or should I fetch it first(only once) and store it as I did".
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Zeiyar Lynn's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord