CacheManager
The CacheManager offers functionality to work with caches.
import { CacheManager } from '@archibald/core';
getInstance
This method gets the CacheManager instance from the SystemManager. If it doesn't exist it initializes a new CacheManager instance and sets it in the SystemManager.
import { CacheManager } from '@archibald/core';
const cacheManger = CacheManager.getInstance();
set
This method sets a cache in the CacheManager.
import { CacheManager } from '@archibald/core';
CacheManager.set(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | A unique identifier for the cache. |
| value | Generic, defaults to BaseCache | A cache to be stored in the CacheManger class. |
get
This method returns a cache for the specified key.
import { CacheManager } from '@archibald/core';
const cache = CacheManager.get(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | A unique identifier for the cache. |
has
This method checks if a cache key exists in the cache.
import { CacheManager } from '@archibald/core';
const isInCache = CacheManager.has(PARAMETERS);
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | A unique identifier for the cache. |