Skip to content

Commit

Permalink
Remove lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed Oct 16, 2024
1 parent 5e97fbe commit a31a9bf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@types/react": "18.3.11",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"lodash": "4.17.21",
"next": "14.2.15",
"npm-run-all": "4.1.5",
"postcss": "8.4.47",
Expand Down
6 changes: 2 additions & 4 deletions packages/react/src/ImageSlider/ImageSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import clsx from 'clsx'
import { debounce } from 'lodash'
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import type { ForwardedRef, HTMLAttributes } from 'react'
import { ImageSliderContext } from './ImageSliderContext'
Expand Down Expand Up @@ -148,9 +147,8 @@ export const ImageSliderRoot = forwardRef(
goToSlide(currentSlideElement)
}

const debouncedHandleResize = debounce(handleResize, 200)
window.addEventListener('resize', debouncedHandleResize)
return () => window.removeEventListener('resize', debouncedHandleResize)
window.addEventListener('resize', handleResize)
return () => window.removeEventListener('resize', handleResize)
}, [currentSlideId, goToSlide])

return (
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a31a9bf

Please sign in to comment.