Chuyển tới nội dung chính

removeStorage

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á dữ liệu trong cache theo cơ chế bất đồng bộ.

Parameters

Object object

PropertyTypeDefaultRequiredDescriptionMinimum Version
keysArray<string>trueDanh sách các key của dữ liệu cần xoá
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Return Values

Promise <Object data>

PropertyTypeDescriptionMinimum Version
errorKeysArray<string>Danh sách các dữ liệu xoá lỗi

Sample Code

import { removeStorage } from "zmp-sdk/apis";

removeStorage({
keys: ["key1", "key2"],
success: (data) => {
// xử lý khi gọi api thành công
const { errorKeys } = data;
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
},
});

Hoặc

import { removeStorage } from "zmp-sdk/apis";

const removeStorageData = async () => {
try {
const { errorKeys } = await removeStorage({
keys: ["key1", "key2"],
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};