clearStorage
Lưu ý
Cần xin cấp quyền tại trang Quản lý ứng dụng
Deprecated: API này đã dừng hỗ trợ. Vui lòng tham khảo api mới tại đây
Xoá toàn bộ dữ liệu trong cache theo cơ chế bất đồng bộ.
Parameters
Object object
Property | Type | Default | Required | Description | Minimum Version |
---|---|---|---|---|---|
success | function | Callback function khi gọi api thành công | |||
fail | function | Callback function khi gọi api thất bại |
Sample Code
import { clearStorage } from "zmp-sdk/apis";
clearStorage({
success: (res) => {
// xử lý khi gọi api thành công
const { key, data } = res;
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
},
});
Hoặc
import { clearStorage } from "zmp-sdk/apis";
const clearData = async () => {
try {
await clearStorage({});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};