-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) style fix on alerts tab, remove unresolve, fix placeholder logi…
…c, fix pagination counting logic
- Loading branch information
1 parent
06e07c8
commit 41785f4
Showing
5 changed files
with
18 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { useState, useEffect } from "react" | ||
|
||
export const useDebounce = (value: string, delay: number) => { | ||
const [debouncedValue, setDebouncedValue] = useState(value); | ||
useEffect( | ||
() => { | ||
const handler = setTimeout(() => { | ||
setDebouncedValue(value); | ||
}, delay); | ||
return () => { | ||
clearTimeout(handler); | ||
}; | ||
}, | ||
[value, delay] | ||
); | ||
return debouncedValue; | ||
const [debouncedValue, setDebouncedValue] = useState(value) | ||
useEffect(() => { | ||
const handler = setTimeout(() => { | ||
setDebouncedValue(value) | ||
}, delay) | ||
return () => { | ||
clearTimeout(handler) | ||
} | ||
}, [value, delay]) | ||
return debouncedValue | ||
} |