Design comparison
Community feedback
- @debriksPosted about 2 years ago
Hi Adarsh,
You're clearly better than I am at Javacript but I noticed that you have the same problem I had on your Advice Generator App and I wanted to share with you the fix I found on stackoverflow, maybe you will find it useful.
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).
I fixed this small issue by simply adding
{ cache: "no-cache" }
to the API response like so:const response = await fetch(END_POINT, { cache: "no-cache" });
Hope you will find this useful.
Happy coding!!
Marked as helpful1 - @vishwa3Posted over 1 year ago
Loved the blur effect on the advice message - have implemented the same in my solution
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