Skip to content

Abstract Class: CachedManager<K, V> ​

Abstract manager for handling cached data structures

Type Parameters ​

NameTypeDescription
Kany
Vany

Constructors ​

Constructor ​

new CachedManager<K, V>(client, holds, iterable?): CachedManager<K, V>

Parameters ​

NameTypeDescription
clientClientThe client that instantiated this manager
holds(...args) => VThe 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() ​

readonly holds: (...args) => V

Parameters ​

NameTypeDescription
argsany[]

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 ​

NameTypeDescription
dataanyThe data to add
cache?booleanWhether to cache the item
options?objectAdditional options

Returns ​

V *? The cached item


resolve(idOrInstance): null | V ​

`

Resolves a data entry to a data Object.

Parameters ​

NameTypeDescription
idOrInstanceK | V

Returns ​

null | V

Inherited from ​

DataManager.resolve


resolveId(idOrInstance): null | K ​

`

Resolves a data entry to an instance id.

Parameters ​

NameTypeDescription
idOrInstanceK | 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