Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tugbanur-React week 3 #25

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Tugbanur-f
Copy link

No description provided.

@Tugbanur-f
Copy link
Author

link

@MaryRichelle MaryRichelle self-assigned this Nov 28, 2024
Copy link

@MaryRichelle MaryRichelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job overall! The fetchData function is well-written, and error handling looks good. Using setTimeout to add a delay works, but it might be better to remove it or make the loading time match the actual fetch time. The code is clean and easy to understand—well done!

setTimeout(() => {
setData(result);
setLoading(false);
}, 1000);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation overall, and the fetchData function works well. However, using setTimeout to simulate a delay might not be the best approach for production. It could be better to handle the loading state dynamically based on the actual fetch duration or remove the artificial delay altogether. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants