Skip to content

Commit b8a3c1d

Browse files
committed
Fix search debounce.
1 parent ab631d0 commit b8a3c1d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/repositories/SearchForm.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import AwesomeDebouncePromise from 'awesome-debounce-promise';
1212

1313
import { repositorySearch } from '../..';
1414

15-
const repositorySearchDebounced = AwesomeDebouncePromise(repositorySearch, 250);
16-
1715
const useStyles = makeStyles(theme => ({
1816
root: {
1917
position: 'sticky',
@@ -41,6 +39,11 @@ function SearchForm({
4139
const [query, setQuery] = useState(defaultQuery);
4240
const [initialSearch, setInitialSearch] = useState(false);
4341

42+
const repositorySearchDebounced = AwesomeDebouncePromise(
43+
async (_props) => { return await repositorySearch(_props) },
44+
250
45+
);
46+
4447
const updateRepositories = useCallback(async (owner, query) => {
4548
const repositories = await repositorySearchDebounced({
4649
owner, query, config,

0 commit comments

Comments
 (0)