Abstract
Initialize the cache
Custom configuration for this instance.
Optional
config?: CacheConfigProtected
configProtected
keySet custom configuration for the cache instance.
Optional
config: Omit<CacheConfig, "keyPrefix">customized configuration (without keyPrefix, which can't be changed)
Protected
fillproduce a JSON object with meta-data and data value
the value of the item
optional, the specified meta-data
Protected
Abstract
getGet item from cache. It will return null if item doesn’t exist or it has been expired. If you specified callback function in the options, then the function will be executed if no such item in the cache and finally put the return value into cache. Please make sure the callback function will return the value you want to put into the cache. The cache will abort output a warning: If the key is invalid If error happened with AsyncStorage
the key of the item
Optional
options: CacheItemOptionsthe options of callback function
Protected
getProtected
isProtected
removeSet item into cache. You can put number, string, boolean or object. The cache will first check whether has the same key. If it has, it will delete the old item and then put the new item in The cache will pop out items if it is full You can specify the cache item options. The cache will abort and output a warning: If the key is invalid If the size of the item exceeds itemMaxSize. If the value is undefined If incorrect cache item configuration If error happened with browser storage
the key of the item
the value of the item
Optional
options: Record<string, any>optional, the specified meta-data
Initialization of the cache