bump lightouse throttle
This commit is contained in:
parent
c382bfd438
commit
6d845d64cd
1 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue