Skip to content

localstorage, sessionStorage, Cookie存取封装(扩展功能:indexDB存取封装)

License

Notifications You must be signed in to change notification settings

juicecube/localStore

Repository files navigation

@mlz/Store

Codacy Badge

封装localStorage, sessionStorage, cookie, indexDB.

安装

npm i @mlz/store

使用

import createStore from '@mlz/store';

const store = createStore({}); // 默认是localStorage, 通过type: 'sessionStorage'|'cookieStorage'|'indexDB'区分

store.set({a: 1});
store.update({a: 1});
store.delete('a');
store.get('a');

TODO

  1. indexDB
  2. remove lodash.merge(it takes 54kb)

About

localstorage, sessionStorage, Cookie存取封装(扩展功能:indexDB存取封装)

Resources

License

Stars

Watchers

Forks

Packages

No packages published