x-ls-cache

1.0.3 • Public • Published

localstorage-cache

针对localstorage频繁取值的节流操作

npm

npm install --save x-ls-cache

demo

let StorageCache = require('x-ls-cache');
StorageCache.time=1000;
StorageCache.get('aaa',true)

api

get (key,isParseJson)

获取localStorage值,key为键值,isParseJson是否转为json对象。

time

配置多少毫秒内不作重复读取,默认为1000;

Readme

Keywords

Package Sidebar

Install

npm i x-ls-cache

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

8.26 kB

Total Files

9

Last publish

Collaborators

  • tianxiangbing