-
Beta Was this translation helpful? Give feedback.
Answered by
Haroenv
Sep 5, 2023
Replies: 1 comment
-
This is actually related to the search client, not InstantSearch, but it's because import { SearchResponse, MultipleQueriesResponse } from "algoliasearch";
function guardSearchResponse<TObject>(
result: MultipleQueriesResponse<TObject>['results'][number]
): asserts result is SearchResponse<TObject> {
return 'hits' in result;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JSShant
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is actually related to the search client, not InstantSearch, but it's because
results
could be of typedefault
orfacet
, you can cast it:guardSearchResponse(lotResultsQuery.data?.results[0])
with