Skip to content

Commit

Permalink
fix: make TS happy with explicit return (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite authored Dec 1, 2023
1 parent a91301e commit b1cbe2a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hooks/useTimeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export default function useTimeout(callback: () => void, delay?: number) {
if (delay) {
timeoutRef.current = window.setTimeout(tick, delay)
return () => window.clearTimeout(timeoutRef.current as number)
} else {
return () => {} // makes TS happy to have an explicit return
}
}, [delay])

Expand Down

0 comments on commit b1cbe2a

Please sign in to comment.