Skip to main content

Interface: UseMenuReturn

Defined in: composables/react/useMenu.ts:53

State and actions returned by useMenu.

Properties

categories

categories: MenuCategory[]

Defined in: composables/react/useMenu.ts:55

The fetched top-level category tree.


clearCache

clearCache: (rootCategoryId, language, userKey?) => void

Defined in: composables/react/useMenu.ts:63

Removes the cached menu entry for the given root category / language / user.

Parameters

rootCategoryId

number

language

string

userKey?

string

Returns

void


error

error: string | null

Defined in: composables/react/useMenu.ts:59

Last error message, or null.


fetchMenu

fetchMenu: (rootCategoryId, userKey?) => Promise<void>

Defined in: composables/react/useMenu.ts:61

Fetches the category tree for a root category id; userKey scopes the cache.

Parameters

rootCategoryId

number

userKey?

string

Returns

Promise<void>


loading

loading: boolean

Defined in: composables/react/useMenu.ts:57

true while a menu fetch is in flight.