reporting.cache
Cache data on-device for your extension.
clear()
clear():
void
Clear the cache for your extension.
Returns
void
get()
get<
T
>(key
,defaultValue
):T
Retrieve a value from the cache. If the key isn't in the cache, this will return the provided defaultValue
.
If the type of value in the cache doesn't match the type of the defaultValue
, the defaultValue
is returned.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
key | string | The unique key for your extension for the cache value. |
defaultValue | T | The value returned if no value is found in the cache. |
Returns
T
replace()
replace(
newCache
):void
Replace the entire existing cache with a new cache.
Parameters
Parameter | Type | Description |
---|---|---|
newCache | Cache | The new cache you'd like to persist. |
Returns
void
set()
set<
T
>(key
,value
):void
Add a key-value pair to the cache. Will overwrite any existing value at the key.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
key | string | The unique key for your extension for the cache value. |
value | T | The value you'd like to store. |
Returns
void