Responsive Advice Generator App

Solution retrospective
Hello Frontend Mentor community.
I really enjoyed this challenge. I had difficulty connecting the frontend to the API but I managed to figure it out. However I do need more practise so if any of you know of any other cool API's I can play around with, please let me know. Also any other feedback on best practises regarding API calls will be appreciated.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @debriks
Hi Mohammed!
Love your solution! The Javascript is clear and concise, well done! I just noticed that you have to push twice the button to get a new advice, it takes a bit of delay. I think you can fix this small issue by simply adding
{ cache: "no-cache" }
to the API response like so:let res = await fetch('https://api.adviceslip.com/advice', { cache: "no-cache" });
Hope you will find this useful.
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