Skip to main content

Interface: UseProductSearchReturn

Defined in: composables/react/useProductSearch.ts:124

State and search actions returned by useProductSearch.

Properties​

currentPage​

currentPage: number

Defined in: composables/react/useProductSearch.ts:136

Current page number (1-based).


currentSortField​

currentSortField: string

Defined in: composables/react/useProductSearch.ts:132

Active sort field.


currentSortOrder​

currentSortOrder: string

Defined in: composables/react/useProductSearch.ts:134

Active sort direction.


displayProducts​

displayProducts: (Product | Cluster)[]

Defined in: composables/react/useProductSearch.ts:126

Products to render — controlled products or the internally fetched list.


fetchProducts​

fetchProducts: () => Promise<void>

Defined in: composables/react/useProductSearch.ts:148

Runs the main category product fetch.

Returns​

Promise<void>


goToPage​

goToPage: (page) => void

Defined in: composables/react/useProductSearch.ts:152

Navigates the main product list to a page.

Parameters​

page​

number

Returns​

void


isLoading​

isLoading: boolean

Defined in: composables/react/useProductSearch.ts:130

true while the main category fetch is in flight (uncontrolled mode only).


itemsFound​

itemsFound: number

Defined in: composables/react/useProductSearch.ts:128

Total matching products across all pages.


search: (term) => void

Defined in: composables/react/useProductSearch.ts:150

Sets the search-bar term and triggers a debounced product search.

Parameters​

term​

string

Returns​

void


searchItemsFound​

searchItemsFound: number

Defined in: composables/react/useProductSearch.ts:144

Total items found by the search-bar query.


searchLoading​

searchLoading: boolean

Defined in: composables/react/useProductSearch.ts:146

true while the debounced search-bar query is in flight.


searchResults​

searchResults: (Product | Cluster)[]

Defined in: composables/react/useProductSearch.ts:142

Results of the debounced search-bar query.


searchTerm​

searchTerm: string

Defined in: composables/react/useProductSearch.ts:140

The current search-bar term.


totalPages​

totalPages: number

Defined in: composables/react/useProductSearch.ts:138

Total number of pages.