diff options
Diffstat (limited to 'src/utils/hooks/use-scroll-position.tsx')
| -rw-r--r-- | src/utils/hooks/use-scroll-position.tsx | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/utils/hooks/use-scroll-position.tsx b/src/utils/hooks/use-scroll-position.tsx deleted file mode 100644 index c6ae9fd..0000000 --- a/src/utils/hooks/use-scroll-position.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { useEffect } from 'react'; - -/** - * Execute the given function based on scroll position. - * - * @param scrollHandler - A callback function. - */ -export const useScrollPosition = (scrollHandler: () => void) => { - useEffect(() => { - window.addEventListener('scroll', scrollHandler); - return () => window.removeEventListener('scroll', scrollHandler); - }, [scrollHandler]); -}; |
