Skip to content

Commit

Permalink
Merge pull request #401 from 00labs/react-hooks
Browse files Browse the repository at this point in the history
update useDebouncedValue hook
  • Loading branch information
shan-57blocks authored Dec 23, 2024
2 parents ce0234e + d74768a commit 088f97d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/huma-web-shared/src/hooks/useDebouncedValue.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect, useState } from 'react'

export const useDebouncedValue = (
value: number | string = '',
export const useDebouncedValue = <T extends number | string | undefined>(
value: T,
delay = 500,
): string | number => {
): T => {
const [debouncedValue, setDebouncedValue] = useState(value)

useEffect(() => {
Expand Down

0 comments on commit 088f97d

Please sign in to comment.