-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add feature of leaderboard search and sort and multiple correct to the application #55
base: main
Are you sure you want to change the base?
Changes from all commits
9c80738
23aafc4
606ec12
7b82097
eb41311
e569d56
dbc59ff
fbc2f45
4dac85f
a6ab84e
28696a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the purpose of handleAddClick function? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try to find a better way than window.location.reload()? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put this setdebounced function in hooks folder |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ const TabViewDashboard = () => { | |
) | ||
} | ||
|
||
export default TabViewDashboard | ||
export default TabViewDashboard |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {useState, useEffect} from 'react' | ||
|
||
const useDebouncedValue = <T>(value: T, delay: number): T => { | ||
const [debouncedValue, setDebouncedValue] = useState<T>(value) | ||
|
||
useEffect(() => { | ||
const handler = setTimeout(() => { | ||
setDebouncedValue(value) | ||
}, delay) | ||
|
||
return () => { | ||
clearTimeout(handler) | ||
} | ||
}, [value, delay]) | ||
|
||
return debouncedValue | ||
} | ||
|
||
export default useDebouncedValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow code structure, patch get requests will not come here