mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-19 15:08:23 +01:00
Improve response filter UX
This commit is contained in:
1 parent
13307a76af
commit
b0e1614aac
2 files changed
+12
-7
No files matched your search
@@ -5,8 +5,8 @@ import { debounce } from '../lib/debounce';
|
||||
export function useDebouncedSetState<T>(
|
||||
defaultValue: T,
|
||||
delay?: number,
|
||||
): [T, Dispatch<SetStateAction<T>>] {
|
||||
): [T, Dispatch<SetStateAction<T>>, Dispatch<SetStateAction<T>>] {
|
||||
const [state, setState] = useState<T>(defaultValue);
|
||||
const debouncedSetState = useMemo(() => debounce(setState, delay), [delay]);
|
||||
return [state, debouncedSetState];
|
||||
return [state, debouncedSetState, setState];
|
||||
}
|
||||
Reference in new issue
Block a user