Advice Generator App with Accessibility Elements

Solution retrospective
I like how I was able to add a loading event for the webpage in addition to the button so that when users enter the page, the advice slip will load as well instead of it being empty and having to press the button to get a random piece of advice.
What I would do differently / improving this project:
- Implementing some sort of loading screen or visual component to show that the advice generator is working.
- Maybe a way to disable the button clicks for two seconds or a visual indicator that the user has to wait before attempting to generate a random piece of advice again.
One thing that I did have a question about in regards to best practices regarding JavaScript async/await
and fetch
is when you use .then()
or .catch()
, should you be nesting them? I suck at explaining lol so see code below for what I mean:
getAdvice() .catch() OR getAdvice() .catch()
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Levi Kuhaulua's solution.
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