Advice Generator with HTML/SCSS/JS

Solution retrospective
This was an interesting challenge to complete! My submission is not quite fully responsive yet, but that will definitely be added soon.
Feel free to let me know if there are any ways that I can improve my code!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @debriks
Hi Ninjagor,
Great solution! Congrats
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 like so (line 5 of yourmain.js
file):`fetch("https://api.adviceslip.com/advice", { cache: "no-cache" });`
Hope you find this helpful.
Happy coding :)
Marked as helpful
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