chore: run prettier

This commit is contained in:
Matthew Penner 2023-01-12 12:31:47 -07:00
parent 9cdbbc3a00
commit 155d7bb876
No known key found for this signature in database
76 changed files with 788 additions and 550 deletions

View file

@ -3,10 +3,10 @@ import { debounce } from 'debounce';
type DebounceFn<V> = ((value: V) => void) & { clear: () => void };
export default <S> (initial: S, interval?: number, immediate?: boolean): [ S, DebounceFn<S> ] => {
const [ state, setState ] = useState<S>(initial);
export default <S>(initial: S, interval?: number, immediate?: boolean): [S, DebounceFn<S>] => {
const [state, setState] = useState<S>(initial);
const debouncedSetState = debounce((v: S) => setState(v), interval, immediate);
return [ state, debouncedSetState ];
return [state, debouncedSetState];
};