Skip to content

Commit 0c974cf

Browse files
committed
minor refactor
1 parent 72ef65c commit 0c974cf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

stories/ColorHelper/ColorHelper.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ export function ColorHelper() {
7070
const [color, setColor] = useState<SearchProps["color"]>(undefined);
7171
const [usage, setUsage] = useState<SearchProps["usage"]>(undefined);
7272

73-
const [, startTransition] = useTransition();
74-
7573
const updateSearch = () => {
7674
setFilteredColorDecisionAndCorrespondingOption(
7775
fzf
@@ -92,12 +90,16 @@ export function ColorHelper() {
9290
);
9391
};
9492

95-
useEffectOnValueChange(() => {
96-
startTransition(() => updateSearch());
97-
}, [context, color, usage]);
98-
9993
useDebounce(updateSearch, [search]);
10094

95+
{
96+
const [, startTransition] = useTransition();
97+
98+
useEffectOnValueChange(() => {
99+
startTransition(() => updateSearch());
100+
}, [context, color, usage]);
101+
}
102+
101103
const { css } = useStyles();
102104

103105
const evtSearchAction = useConst(() => Evt.create<"scroll to">());

0 commit comments

Comments
 (0)