mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Webatrice: KnownHosts component (#4456)
* refactor dexie services for future schema updates Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
37879c4255
commit
6ce346af4a
54 changed files with 1381 additions and 1291 deletions
13
webclient/src/hooks/useDebounce.ts
Normal file
13
webclient/src/hooks/useDebounce.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { useCallback } from 'react';
|
||||
import { debounce, DebouncedFunc } from 'lodash';
|
||||
|
||||
type UseDebounceType = (...args: any) => any;
|
||||
const DEBOUNCE_DELAY = 250;
|
||||
|
||||
export function useDebounce<T extends UseDebounceType>(
|
||||
fn: T,
|
||||
deps: any[] = [],
|
||||
timeout: number = DEBOUNCE_DELAY
|
||||
): DebouncedFunc<T> {
|
||||
return useCallback(debounce(fn, timeout), deps);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue