Better handling of large responses

This commit is contained in:
Gregory Schier
2024-07-23 08:59:15 -07:00
parent f24fd13c45
commit 13183ae837
5 changed files with 66 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ import { useRef, useState } from 'react';
import { useUnmount } from 'react-use';
/** Returns a boolean that is true for a given number of milliseconds. */
export function useTimedBoolean(millis = 1000): [boolean, () => void] {
export function useTimedBoolean(millis = 1500): [boolean, () => void] {
const [value, setValue] = useState(false);
const timeout = useRef<NodeJS.Timeout | null>(null);
const reset = () => timeout.current && clearTimeout(timeout.current);