Skip to main content

Class: CacheFactory<V>

@ima/core.CacheFactory

Factory for creating instances of CacheEntry.

Type parameters

Name
V

Constructors

constructor

new CacheFactory<V>()

Type parameters

Name
V

Accessors

$dependencies

Static get $dependencies(): Dependencies

Returns

Dependencies

Defined in

packages/core/src/cache/CacheFactory.ts:8

Methods

createCacheEntry

createCacheEntry(value, ttl): CacheEntry<V>

Create a new instance of CacheEntry with value and ttl.

Parameters

NameTypeDescription
valueVThe cache entry value.
ttlstring | numberCache entry time to live in milliseconds. The entry will expire after the specified amount of milliseconds.

Returns

CacheEntry<V>

The created cache entry.

Defined in

packages/core/src/cache/CacheFactory.ts:21