Methods
addCurrentToMenuItem(item)
Add the current class and attributes to a menu item.
Parameters:
| Name | Type | Description |
|---|---|---|
item | HTMLElement | The menu item to add the current class and attributes to. |
- Since
- 4.0.2
buildCacheKey(prefix, paramKeys, params) → {string}
Build a cache key.
Parameters:
| Name | Type | Description |
|---|---|---|
prefix | string | The prefix for the cache key. |
paramKeys | Array | The keys of the parameters to build the cache key. |
params | object | The parameters to build the cache key. |
- Since
- 4.0.2
- Source
Returns:
The cache key.
- Type:
- string
removeCurrentFromMenuItem(item)
Remove the current class and attributes from a menu item.
Parameters:
| Name | Type | Description |
|---|---|---|
item | HTMLElement | The menu item to remove the current class and attributes from. |
- Since
- 4.0.2
useCache(initialState) → {object}
A hook to manage a cache.
Parameters:
| Name | Type | Description |
|---|---|---|
initialState | object | The initial state of the cache. |
- Since
- 4.0.2
- Source
Returns:
The cache state and actions.
- Type:
- object
useId(defaultId) → {string}
Generates a unique ID if default ID is not provided.
Parameters:
| Name | Type | Description |
|---|---|---|
defaultId | string | The default ID. |
- Since
- 3.2.2
- Source
Returns:
The ID.
- Type:
- string