pawarspeaks / TechNexus

TechNexus is a global hub for tech events! Join the Dev Code community's open-source initiative to discover, curate, and add discover technical events around the world. Contribute now and be part of this exciting global collaboration! ...❤️... Join our contributor discussion: https://discord.gg/G2acRSSdhX
https://devcode-technexus.vercel.app
39 stars 62 forks source link

[Performance] Implement Debounced Scroll Listener for Improved Performance in ScrollToTopButton Component #123

Open karthik-script opened 3 days ago

karthik-script commented 3 days ago

Hi @pawarspeaks, I can fix this issue for you. Please assign it to me. Also, can you please add Labels on this for Hactoberfest? Thanks.

Description:

The current ScrollToTopButton component listens to the scroll event continuously, which can lead to performance issues due to frequent state updates. To improve performance, we need to debounce or throttle the scroll listener to reduce the frequency of calls to the listenToScroll function.

src/components/ScrollToTopButton.jsx

Tasks:

  1. Implement Throttling/Debouncing:

    • Use a library like lodash.throttle or lodash.debounce to limit the scroll event handling frequency.
  2. Test Performance:

    • Verify that performance improves and the scroll-to-top functionality remains smooth across various scroll speeds.

Benefits:

pawarspeaks commented 10 hours ago

@karthik-script assigned..do link this issue while raising the PR