Design comparison
Solution retrospective
First time using an API was a good exp had fun reading about it kinda works how it should i guess ill add more features to is a i learn more :) and suggestions are welcomed
Community feedback
- @debriksPosted about 2 years ago
Hi Yonatan!
Your solution looks good! I just have one little suggestion to improve it. In your app, you have to push twice the button to get a new advice, it takes a bit of delay. It is because of the cache (there's actually a note about it on the API website :
Advice is cached for 2 seconds. Any repeat-request within 2 seconds will return the same piece of advice).
This small issue can be fixed by simply adding
{ cache: "no-cache" }
to the API response so in your case, just adding it in yourmain.js
file like this (line 10):const file = fetch(testURL, { cache: "no-cache" })
Hope you find this helpful.
Happy coding :)
Marked as helpful0@YehonatalPosted about 2 years ago@debriks i was gonna check why that was happening thank you really helped :)
1@debriksPosted about 2 years ago@R4nn3r Really happy to know this info could help you!
Keep up the good work and happy coding :)
0
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