foca-storage-engine
v0.0.1
Published
独立存储引擎
Downloads
3
Readme
foca-storage-engine
独立存储引擎
安装
yarn add foca-storage-engine
支持引擎
- localStorage
- sessionStorgae
- memoryStorage
使用方式
import { engines } from 'foca-storage-engine';
engines.localStorage.getItem('key').then((value) => {
console.log(value);
});
自定义引擎
import { StorageEngine } from 'foca-storage-engine';
const myEngine: StorageEngine = {
getItem(key) {},
setItem(key, value) {},
removeItem(key) {},
clear() {},
};