the configuration of the cache
decrease current size of the cache
the amount of the cache size which needs to be decreased
scan the storage and find out all the keys owned by this cache also clean the expired keys while scanning
array of keys
increase current size of the cache
the amount of the cache szie which need to be increased
see whether cache is full
true if cache is full
check wether item is expired
the key of the item
true if the item is expired.
get all the items we have, sort them by their priority, if priority is same, sort them by their last visited time pop out items from the low priority (5 is the lowest)
all the keys in this cache
the total size of the items which needed to be poped out
update the visited time if item has been visited
the item which need to be refreshed
the key of the item
the refreshed item
delete item from cache
the key of the item
optional, the byte size of the item
put item into cache
the key of the item
total space needed when poping out items
total space needed
clear the entire cache The cache will abort output a warning: If error happened with AsyncStorage
set cache with customized configuration
customized configuration
Return a new instance of cache with customized configuration.
the customized configuration
produce a JSON object with meta-data and data value
the value of the item
optional, the specified meta-data
Return all the keys in the cache. Will return an empty array if error happend.
return the current size of the cache
Get 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
remove item from the cache The cache will abort output a warning: If error happened with AsyncStorage
the key of the item
Set 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
initialize the cache