dlt.removeStorage
Introduction
Removes a specified key from the local cache.
Parameters
Object object
Property | Type | Default | Required | Description |
---|---|---|---|---|
key | string | Yes | The key of the item to be removed from the local cache. | |
success | function | No | Callback function for a successful API call. | |
fail | function | No | Callback function for a failed API call. | |
complete | function | No | Callback function that will be executed when the API call is complete (both successful and failed calls). |
object.success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | true - successful |
object.fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | false - failed |
Example Code
// pages/index/index.js
Page({
removeStorage() {
dlt.removeStorage({
key: "key",
success: function (res) {
console.log(res);
},
});
},
});