Class: Cache
Abstract interface representing a subset of the Manager
class caching functionality that can be maintained in a simple key-value store.
Hierarchy
- Cache
Index
Methods
Methods
getQueries
▸ getQueries(paths
: string | Array‹string›): Promise‹Array‹string››
Defined in lib/control/Manager.ts:43
Returns the query strings of all cached states
that are dependent on the state at the given paths
.
Parameters:
Name | Type | Description |
---|---|---|
paths |
string | Array‹string› | A path string or array of path strings. |
Returns: Promise‹Array‹string››
getState
▸ getState(query
: string): Promise‹State›
Defined in lib/control/Manager.ts:35
Retrieves the state associated with a given query
string from the cache, or undefined
if no such state exists.
Parameters:
Name | Type | Description |
---|---|---|
query |
string | A query string. |
Returns: Promise‹State›
setState
▸ setState(state
: State): Promise‹boolean›
Defined in lib/control/Manager.ts:19
Stores a State
instance such that it can later be retrieved by its query
string via a call to Cache.prototype.getState
, and such that its query string can be retrieved via a call to Cache.prototype.getQueries
with any of the state's dependent
paths.
Parameters:
Name | Type | Description |
---|---|---|
state |
State |
Returns: Promise‹boolean›
unset
▸ unset(query
: string): Promise‹boolean›
Defined in lib/control/Manager.ts:27
Removes the State
instance associated with a given query
string from the cache.
Parameters:
Name | Type | Description |
---|---|---|
query |
string | A query string. |
Returns: Promise‹boolean›