diff options
author | dan <dan.abramov@gmail.com> | 2024-08-22 22:43:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-22 22:43:23 +0100 |
commit | 27bb3832683275be0c778a38c526bfd55cebee59 (patch) | |
tree | 02b0e1a9c802b0f75ac33d3e00daa95203e322cc /src/components/hooks/useThrottledValue.ts | |
parent | df5bf28e614150bda5d58b22b7db308f71f70e07 (diff) | |
download | voidsky-27bb3832683275be0c778a38c526bfd55cebee59.tar.zst |
Submit fix (#4978)
* Fix submit logic * Fix type * Align submit task creation 1:1 with callsites * blegh. `useThrottledValue` * make `useThrottledValue`'s time required --------- Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/components/hooks/useThrottledValue.ts')
-rw-r--r-- | src/components/hooks/useThrottledValue.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/hooks/useThrottledValue.ts b/src/components/hooks/useThrottledValue.ts index 5764c547e..29a11b935 100644 --- a/src/components/hooks/useThrottledValue.ts +++ b/src/components/hooks/useThrottledValue.ts @@ -2,7 +2,7 @@ import {useEffect, useRef, useState} from 'react' import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' -export function useThrottledValue<T>(value: T, time?: number) { +export function useThrottledValue<T>(value: T, time: number) { const pendingValueRef = useRef(value) const [throttledValue, setThrottledValue] = useState(value) |