Skip to content

Commit

Permalink
refactor: use same name as lodash for debounce cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljablonski committed Jan 15, 2024
1 parent 4f2c48f commit f86b7d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ const Tooltip = ({
// from leave A prevented the leave B event from calling it, leaving the
// tooltip visible.
const debouncedHandleShowTooltip = (e?: Event) => {
internalDebouncedHandleHideTooltip.reset()
internalDebouncedHandleHideTooltip.cancel()
internalDebouncedHandleShowTooltip(e)
}
const debouncedHandleHideTooltip = () => {
internalDebouncedHandleShowTooltip.reset()
internalDebouncedHandleShowTooltip.cancel()
internalDebouncedHandleHideTooltip()
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const debounce = <T, A extends any[]>(
}
}

debounced.reset = () => {
debounced.cancel = () => {
if (!timeout) {
return
}
Expand Down

0 comments on commit f86b7d7

Please sign in to comment.