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

Refactor code to improve readability and maintainability #832

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thevijayshankersharma
Copy link

πŸ‘¨β€πŸ’» Changes proposed

This pull request refactors the fetchData function to improve readability and maintainability. The changes introduce modern JavaScript features and coding conventions, resulting in cleaner and more concise code.

Key Changes:

Async/Await: Replaced promise chaining with async/await syntax for fetching data asynchronously.
Error Handling: Implemented try-catch blocks for error handling during data fetching.
Nullish Coalescing Operator: Utilized the nullish coalescing operator (??) to handle cases where the fetched data may be null or undefined.
Code Comments: Removed unnecessary comments and added explanatory comments where necessary.
HTML Generation: Refactored the code to generate HTML elements using map and join methods.

βœ”οΈ Check List (Check all the applicable boxes)

  • [βœ” ] My code follows the code style of this project.
  • [βœ” ] This PR does not contain plagiarized content.
  • [βœ” ] The title of my pull request is a short description of the requested changes.

πŸ“„ Note to reviewers

Feedback and suggestions for further improvements are welcome.

πŸ“· Screenshots

Copy link

netlify bot commented May 13, 2024

βœ… Deploy Preview for codeincommunitytech ready!

Name Link
πŸ”¨ Latest commit 9c3cb56
πŸ” Latest deploy log https://app.netlify.com/sites/codeincommunitytech/deploys/6641c1b46a92760008402cba
😎 Deploy Preview https://deploy-preview-832--codeincommunitytech.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 13, 2024

βœ… Deploy Preview for codeincommunity ready!

Name Link
πŸ”¨ Latest commit 9c3cb56
πŸ” Latest deploy log https://app.netlify.com/sites/codeincommunity/deploys/6641c1b472e0a70008b74338
😎 Deploy Preview https://deploy-preview-832--codeincommunity.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

Successfully merging this pull request may close these issues.

1 participant