Skip to content

Commit 235503e

Browse files
refactor: use same name as lodash for debounce cancel
1 parent 54bc0cb commit 235503e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/Tooltip/Tooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,11 @@ const Tooltip = ({
380380
// from leave A prevented the leave B event from calling it, leaving the
381381
// tooltip visible.
382382
const debouncedHandleShowTooltip = (e?: Event) => {
383-
internalDebouncedHandleHideTooltip.reset()
383+
internalDebouncedHandleHideTooltip.cancel()
384384
internalDebouncedHandleShowTooltip(e)
385385
}
386386
const debouncedHandleHideTooltip = () => {
387-
internalDebouncedHandleShowTooltip.reset()
387+
internalDebouncedHandleShowTooltip.cancel()
388388
internalDebouncedHandleHideTooltip()
389389
}
390390

src/utils/debounce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const debounce = <T, A extends any[]>(
3737
}
3838
}
3939

40-
debounced.reset = () => {
40+
debounced.cancel = () => {
4141
if (!timeout) {
4242
return
4343
}

0 commit comments

Comments
 (0)