Submitted over 2 years ago
Github Search using React and TypeScript
@EmanueleGurini
Design comparison
SolutionDesign
Solution retrospective
I'm looking for feedback that can bring me write better code. I suggest checking the fetch process because I think it can be written better: feel free to write everything you find useful.
Community feedback
- @Ibarra11Posted over 2 years ago
One thing that I noticed about your fetch function is your mixing up async/await with promises. There is nothing wrong with what you did, but it might make the code more readable if you just stick to either to promises or async/await. For example,
const response = await fetch(your api); const data = await response.json();
Marked as helpful1@EmanueleGuriniPosted over 2 years ago@Ibarra11 Hi Alan, you've right indeed! I've just modified the code as you suggest. Thanks a lot!
0
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