Skip to content

Commit 16a3b45

Browse files
committed
refactor: rename variable
1 parent 9c4bed7 commit 16a3b45

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

packages/autocomplete-core/src/onInput.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ export function onInput<TItem extends BaseItem>({
5454
setActiveItemId(props.defaultActiveItemId);
5555

5656
if (!query && props.openOnFocus === false) {
57-
const newCollections = store.getState().collections.map((collection) => ({
57+
const collections = store.getState().collections.map((collection) => ({
5858
...collection,
5959
items: [],
6060
}));
6161

6262
setStatus('idle');
63-
setCollections(newCollections);
63+
setCollections(collections);
6464
setIsOpen(
6565
nextState.isOpen ?? props.shouldPanelOpen({ state: store.getState() })
6666
);
@@ -69,9 +69,7 @@ export function onInput<TItem extends BaseItem>({
6969
// promises to keep late resolving promises from "cancelling" the state
7070
// updates performed in this code path.
7171
// We chain with a void promise to respect `onInput`'s expected return type.
72-
return runConcurrentSafePromise(newCollections).then(() =>
73-
Promise.resolve()
74-
);
72+
return runConcurrentSafePromise(collections).then(() => Promise.resolve());
7573
}
7674

7775
setStatus('loading');

0 commit comments

Comments
 (0)