react-scrollspy icon indicating copy to clipboard operation
react-scrollspy copied to clipboard

Wrong throttling implementation

Open mareksuscak opened this issue 5 years ago • 1 comments

Update throttling is implemented incorrectly on this line. It not only doesn't throttle the provided function at all (in fact a result of calling _spy is passed into throttle). It also creates a new function every time a scroll event is fired. This results in a huge performance hit and increased memory usage due to the number of allocations.

mareksuscak avatar Jan 14 '20 21:01 mareksuscak

Submitted a PR: https://github.com/makotot/react-scrollspy/pull/128

mareksuscak avatar Dec 10 '20 02:12 mareksuscak