Lesson 6 Data Cache


1. Data cache

6.1 uni.setStorage

Storing data in the key specified in the local cache will overwrite the original content corresponding to the key , which is an asynchronous interface.

 

picture


picture


picture


picture

 

picture


6.2 uni.getStorage

Asynchronously obtains the content corresponding to the specified key from the local cache .

 

picture

picture

picture

 

picture

 

picture

 

picture

 

picture

 

6.3 uni.removeStorage

Asynchronously removes the specified key from the local cache .

 

picture

 

picture

 

picture

picture

 

picture

6.4 uni.setStorageSync

Storing data in the key specified in the local cache will overwrite the original content corresponding to the key , which is a synchronous interface.

 

picture

 

picture

 

picture

 

6.5 uni.getStorageSync

Synchronously obtain the content corresponding to the specified key from the local cache .

 

picture

 

picture

 

picture

6.6 uni.removeStorageSync(KEY)

Synchronously remove the specified key from the local cache .

 

picture

 

picture

 

picture