IAsyncCache Interface
Signature
export interface IAsyncCache<TKey, TValue>
Type Parameters
Parameter | Description |
---|---|
TKey | |
TValue |
Methods
Method | Return Type | Description |
---|---|---|
get(key) | Promise<TValue | undefined> | |
lock(callback) | Promise<T> | |
save(key, value) | Promise<void> |
Method Details
get
Signature
get(key: TKey): Promise<TValue | undefined>;
Parameters
Parameter | Type | Description |
---|---|---|
key | TKey |
Returns
Return type: Promise<TValue | undefined>
lock
Signature
lock<T>(callback: () => Promise<T>): Promise<T>;
Type Parameters
Parameter | Description |
---|---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
callback | () => Promise<T> |
Returns
Return type: Promise<T>
save
Signature
save(key: TKey, value: TValue): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
key | TKey | |
value | TValue |
Returns
Return type: Promise<void>