Design comparison
Solution retrospective
APIs. First go at using one. I quickly came across the fetch() method and ran with it. Will continue to work on more complicated API data integration. Noticed that firefox might not fetch more than once and I'll need to figure that out.
Community feedback
- @melwyntPosted over 2 years ago
Hi! Great job on the integration of the design and API.
Regarding the issue with
fetch
not retrieving a fresh advice, it has to do with the fact that the data is being cached.One way to overcome this is to make sure the API URL you're requesting is always unique. This can be done by adding a timestamp in the URL.
And if you would like to view the solution directly, you can checkout my solution here.
I'm using React and Axios but the JS logic can be reused in your project.
Cheers and happy coding!
PS: by always changing the URL, you'll also be able to bypass the 2-second rule of the API
Marked as helpful0@neenrevaPosted over 2 years ago@melwynt Thank you so much for explaining that. I feel like it's easy to go down rabbit holes on new info like this(which I've been doing a lot lately). It's extremely nice to get solid direction from people like yourself.
1
Please log in to post a comment
Log in with GitHubJoin 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