存储

此接口提供了一种简单的基于键的本地存储机制。如果您需要更强大的选项来持久化数据并对其进行操作,请考虑使用 ReactXP 的数据库扩展

方法

// Clears all local storage keys
clear(): SyncTasks.Promise<void>;

// Returns an item by key
getItem(key: string): SyncTasks.Promise<string>;

// Deletes an item by key
removeItem(key: string): SyncTasks.Promise<void>;

// Sets or replaces the value of an item by key
setItem(key: string, value: string): SyncTasks.Promise<void>;