Abstract Class: CachedManager<K, V>
Abstract manager for handling cached data structures
Type Parameters
| Name | Type | Description |
|---|---|---|
K | any | |
V | any |
Constructors
Constructor
new CachedManager<
K,V>(client,holds,iterable?):CachedManager<K,V>
Parameters
| Name | Type | Description |
|---|---|---|
client | Client | The client that instantiated this manager |
holds | (...args) => V | The data structure this manager holds |
iterable? | Iterable<V, any, any> | An iterable of items to cache |
Returns
CachedManager<K, V>
Overrides
DataManager<K, V>.constructor
Properties
holds()
readonlyholds: (...args) =>V
Parameters
| Name | Type | Description |
|---|---|---|
args | any[] |
Returns
V
Inherited from
DataManager.holds
Accessors
cache
Get Signature
get cache():
Map<K,V>
The cache of items for this manager
Returns
Map<K, V>
Overrides
DataManager.cache
Methods
_add()
protected_add(data,cache?,options?):V
Adds an item to the cache
Parameters
| Name | Type | Description |
|---|---|---|
data | any | The data to add |
cache? | boolean | Whether to cache the item |
options? | object | Additional options |
Returns
V*? The cached item
resolve(idOrInstance): null | V
`
Resolves a data entry to a data Object.
Parameters
| Name | Type | Description |
|---|---|---|
idOrInstance | K | V |
Returns
null | V
Inherited from
DataManager.resolve
resolveId(idOrInstance): null | K
`
Resolves a data entry to an instance id.
Parameters
| Name | Type | Description |
|---|---|---|
idOrInstance | K | V |
Returns
null | K
Inherited from
DataManager.resolveId
valueOf()
valueOf():
Map<K,V>
Returns the primitive value of the specified object.
Returns
Map<K, V>
Inherited from
DataManager.valueOf