Design comparison
Solution retrospective
I feel the generator functions in a good way, i'm happy with how it works using a random generator to pick an advice from the api at random instead of waiting every 2 seconds for the advice that is fed from the plain api to change.
At this moment i don't think I would have done anything different.
What challenges did you encounter, and how did you overcome them?Understanding how the advice slip json api worked, and using useeffect hook from react to change fetch the advice and change it everytime the button was clicked.
I had the problem that using just the plain advice fetch wouldn't change the advice, so a work around was to generate a random number and fetch the advice number corresponding to this random number generated, that way it ensured i would get a random advice everytime without the 2 seconds wait from the plain api and it fixed my problem.
What specific areas of your project would you like help with?Any advice or feedback would be appreciated.
Community feedback
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