add debounce time for apis-docs

Signed-off-by: MiguelRamBalt <v-migueramirez@expediagroup.com>
This commit is contained in:
MiguelRamBalt
2021-04-09 07:16:16 -05:00
parent 89f5ecf0ef
commit a42aafb4c5
2 changed files with 3 additions and 1 deletions
@@ -58,6 +58,7 @@ type SetQueryParams<T> = (params: T) => void;
export function useQueryParamState<T>(
stateName: string,
debounceTime: number = 100,
): [T | undefined, SetQueryParams<T>] {
const navigate = useNavigate();
const location = useLocation();
@@ -85,7 +86,7 @@ export function useQueryParamState<T>(
navigate({ ...location, search: `?${queryString}` }, { replace: true });
}
},
100,
debounceTime,
[queryParamState],
);
@@ -156,6 +156,7 @@ export const ApiExplorerTable = ({
}: ExplorerTableProps) => {
const [queryParamState, setQueryParamState] = useQueryParamState<TableState>(
'apiTable',
500,
);
if (error) {