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

Update(SampleDropdown & Store): Memoization & Redundancy fix with Readability & Modularity #122

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

Conversation

nitro56565
Copy link
Contributor

Optimized SampleDropdown & Store - Memoization & Redundancy fix with Readability & Modularity

Changes

SampleDropdown

  • Optimized dropdown by using shallow comparison from zustand/shallow to prevent redundant re-renders.
  • Used useMemo for dropdown items to prevent unnecessary recalculations.
  • Used useCallback for handleMenuClick to avoid function recreation on each render.
  • Wrapped the component with memo to prevent unnecessary re-renders.

Store

  • Avoided redundant calls to get() within rebuild to improve efficiency.
  • Ensured debounce optimization (rebuildDeBounce) remains effective.

Related Issues

  • Issue #
  • Pull Request #

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

@nitro56565 nitro56565 requested a review from a team as a code owner February 11, 2025 08:06
Copy link

netlify bot commented Feb 11, 2025

Deploy Preview for ap-template-playground ready!

Name Link
🔨 Latest commit c1507e1
🔍 Latest deploy log https://app.netlify.com/sites/ap-template-playground/deploys/67ab04f2925ecc00080caba0
😎 Deploy Preview https://deploy-preview-122--ap-template-playground.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.

@DianaLease
Copy link
Member

Thanks for the contribution, can you add a link to the issue that your PR is addressing?

@nitro56565
Copy link
Contributor Author

@DianaLease This issue has not been raised yet, as #117 was created specifically for optimizing the AP libraries, which is still in progress. In the meantime, I started working on other aspects of the files that needed optimization, leading to this PR.

If you prefer, I can create a separate issue addressing this optimization work before proceeding further.

@DianaLease
Copy link
Member

@DianaLease This issue has not been raised yet, as #117 was created specifically for optimizing the AP libraries, which is still in progress. In the meantime, I started working on other aspects of the files that needed optimization, leading to this PR.

If you prefer, I can create a separate issue addressing this optimization work before proceeding further.

Yes, please create a new issue for the items being addressed in this PR. thank you!

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.

2 participants