Skip to content

Commit

Permalink
refactor(core): rename for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 authored and bjoerge committed Feb 26, 2024
1 parent a2f3555 commit 3e7d439
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function useSearch({
const maxFieldDepth = useSearchMaxFieldDepth()
const strategy = useWorkspace().search.__experimental_strategy

const searchWeighted = useMemo(
const search = useMemo(
() =>
createSearch(
getSearchTypesWithMaxDepth(getSearchableOmnisearchTypes(schema), maxFieldDepth),
Expand Down Expand Up @@ -128,7 +128,7 @@ export function useSearch({
iif(
() => hasSearchableTerms({allowEmptyQueries, terms: request.terms}),
// If we have a valid search, run async fetch, map results and trigger `onComplete` / `onError` callbacks
(searchWeighted(request.terms, request.options) as Observable<WeightedHit[]>).pipe(
(search(request.terms, request.options) as Observable<WeightedHit[]>).pipe(
map((hits) => ({hits})),
tap(({hits}) => onComplete?.(hits)),
catchError((error) => {
Expand Down Expand Up @@ -157,7 +157,7 @@ export function useSearch({
)
},
// eslint-disable-next-line react-hooks/exhaustive-deps -- @todo: add onComplete, onError and onStart to the deps list when it's verified that it's safe to do so
[allowEmptyQueries, searchWeighted],
[allowEmptyQueries, search],
)

const handleSearch = useCallback(
Expand Down

0 comments on commit 3e7d439

Please sign in to comment.