Cache
class provides CRUD-style methods (get, set, remove) to update and retrieve data synchronously based on a key. The data must be a string and it is up to the client to decide which serialization format to use. A typical use case would be to use JSON.stringify
and JSON.parse
.namespace
per command if needed (for example, set it to environment.commandName
).true
if the cache is empty, false
otherwise.boolean
undefined
is returned. If you want to just check for the existence of a key, use has.string
true
if data for the key exists, false
otherwise. You can use this method to check for entries without affecting the LRU access.string
capacity
, the least recently used entries are removed. This also notifies registered subscribers (see subscribe).string
string
true
if data for the key was removed, false
otherwise.notifySubscribers
option is set to false
.notifySubscribers
property. The default is true
; set to false
to disable notification of subscribers.object
key
of the Cache entry that was updated or undefined
when the Cache is cleared, and the associated data
.number
string