MCPcopy Create free account
hub / github.com/dailydotdev/apps / onValueChanged

Function onValueChanged

packages/shared/src/components/PostsSearch.tsx:134–152  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

132 defaultSearchDebounceMs,
133 );
134 const onValueChanged = (value: string) => {
135 typedQuery.current = value;
136
137 if (!value.length) {
138 setQuery('');
139 initialQuery.current = '';
140 onClearQuery?.();
141 setIsFocused(false);
142 return;
143 }
144
145 if (value && value !== initialQueryProp) {
146 debounceQuery(value);
147 }
148
149 if (value !== initialQuery.current) {
150 setIsFocused(true);
151 }
152 };
153
154 useEffect(() => {
155 if (autoFocus) {

Callers

nothing calls this directly

Calls 1

onClearQueryFunction · 0.85

Tested by

no test coverage detected