Design comparison
Solution retrospective
I think there is not enought information about height and stuff i think it should be , bcouse i would then more properly set height css options
if you find anything in my code that could be written more efficiently , then let me know please !
Community feedback
- @debriksPosted about 2 years ago
Hi!
Great solution! 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):axios.get("https://api.adviceslip.com/advice", { cache: "no-cache" })
Hope you find this helpful.
Happy coding :)
Marked as helpful1
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