Skip to content

Commit

Permalink
[Chore] Fix debounce typing
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Aug 24, 2022
1 parent 3db186e commit 34ebb88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -247,6 +247,7 @@
"@testing-library/react-hooks": "^3.4.2",
"@types/d3-array": "^2.0.0",
"@types/d3-scale": "^3.2.2",
"@types/lodash.debounce": "^4.0.6",
"@types/geojson": "^7946.0.7",
"@types/redux-actions": "^2.6.2",
"@types/supercluster": "^7.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/portaled.tsx
Expand Up @@ -46,8 +46,8 @@ const getPageOffset = () => ({

const addEventListeners = () => {
if (document && document.body)
document.body.addEventListener('mousewheel', debounce(startListening, 100));
window.addEventListener('resize', debounce(startListening, 50));
document.body.addEventListener('mousewheel', debounce(startListening, 100, {leading: true}));
window.addEventListener('resize', debounce(startListening, 50, {leading: true}));
};

interface GetChildPosProps {
Expand Down

0 comments on commit 34ebb88

Please sign in to comment.