@gulibs/react-storage
v0.0.5
Published
> 带过期时间的本地存储
Downloads
2
Readme
React Stroage
带过期时间的本地存储
安装
npm install --save @gulibs/react-storage
or
yarn add @gulibs/react-storage
使用
import { ReactStorage } from '@gulibs/react-storage';
const App: React.FC = ()=> {
const storage = ReactStorage.getInstance();
useEffect(()=> {
storage.type = 'sessionStorage';
storage.type = 'localStorage';
storage.set('hello', '你好');
console.log('get', storage.get('hello'));
console.log("getKeys", storage.getKeys());
storage.remove('test');
storage.removeExpired();
storage.removeAll();
}, []);
...
}