Helper functions for managing function cache.
- Source
Methods
(async, static) clear(optsopt)
Clear all cached function items.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
opts | object | <optional> | {} | The options for clearing the cache |
- Source
(async, static) get(optsopt) → {Promise.<*>}
Get a cached function item by key.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | object | <optional> | {} | The options for retrieving the cached item Properties
|
- Source
Returns:
- Returns the cached function item or undefined if expired/not found
- Type:
- Promise.<*>
(async, static) remove(optsopt)
Remove a cached function item by key.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | object | <optional> | {} | The options for removing the cached item Properties
|
- Source
(async, static) set(optsopt) → {Promise.<boolean>}
Set a cached function item.
Parameters:
| Name | Type | Attributes | Default | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | object | <optional> | {} | The options for setting the cached item Properties
|
- Source
Returns:
- Returns true if the item was successfully cached
- Type:
- Promise.<boolean>