bump lightouse throttle

This commit is contained in:
zeppi 2021-06-16 14:11:45 -04:00 committed by Thomas Zarebczan
parent c382bfd438
commit 6d845d64cd
No known key found for this signature in database
GPG key ID: D505010BDB4364BC

View file

@ -11,10 +11,11 @@ export default function useLighthouse(
size?: number = 5, size?: number = 5,
additionalOptions: any = {} additionalOptions: any = {}
) { ) {
const THROTTLE_MS = 1000;
const [results, setResults] = React.useState(); const [results, setResults] = React.useState();
const [loading, setLoading] = React.useState(); const [loading, setLoading] = React.useState();
const queryString = query ? getSearchQueryString(query, { nsfw: showMature, size, ...additionalOptions }) : ''; const queryString = query ? getSearchQueryString(query, { nsfw: showMature, size, ...additionalOptions }) : '';
const throttledQuery = useThrottle(queryString, 500); const throttledQuery = useThrottle(queryString, THROTTLE_MS);
React.useEffect(() => { React.useEffect(() => {
if (throttledQuery) { if (throttledQuery) {