Skip to content

Commit

Permalink
Debounce typings added (#1825)
Browse files Browse the repository at this point in the history
Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
  • Loading branch information
dariaterekhova-actionengine committed Jun 3, 2022
1 parent 1034c33 commit 371649c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -111,6 +111,7 @@
"@types/keymirror": "^0.1.1",
"@types/lodash.clonedeep": "^4.5.7",
"@types/lodash.curry": "^4.1.7",
"@types/lodash.debounce": "^4.0.7",
"@types/lodash.flattendeep": "^4.4.7",
"@types/lodash.get": "^4.4.6",
"@types/lodash.isequal": "^4.5.5",
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, true));
window.addEventListener('resize', debounce(startListening, 50, true));
document.body.addEventListener('mousewheel', debounce(startListening, 100));
window.addEventListener('resize', debounce(startListening, 50));
};

interface GetChildPosProps {
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Expand Up @@ -3296,6 +3296,13 @@
dependencies:
"@types/lodash" "*"

"@types/lodash.debounce@^4.0.7":
version "4.0.7"
resolved "https://registry.yarnpkg.com/@types/lodash.debounce/-/lodash.debounce-4.0.7.tgz#0285879defb7cdb156ae633cecd62d5680eded9f"
integrity sha512-X1T4wMZ+gT000M2/91SYj0d/7JfeNZ9PeeOldSNoE/lunLeQXKvkmIumI29IaKMotU/ln/McOIvgzZcQ/3TrSA==
dependencies:
"@types/lodash" "*"

"@types/lodash.flattendeep@^4.4.7":
version "4.4.7"
resolved "https://registry.yarnpkg.com/@types/lodash.flattendeep/-/lodash.flattendeep-4.4.7.tgz#0ce3dccbe006826d58e9824b27df4b00ed3e90e6"
Expand Down

0 comments on commit 371649c

Please sign in to comment.