cache-yang

封装 localStorage | sessionStorage 的应用库,并且可以设置过期时间

Usage no npm install needed!

<script type="module">
  import cacheYang from 'https://cdn.skypack.dev/cache-yang';
</script>

README

cache-yang

封装 localStorage | sessionStorage 的应用库,并且可以设置过期时间


import { ICache } from "cache-yang";

const defaultCache = new ICache('test', 'sessionStorage')
defaultCache.set('xxxx', 10)
const getCacheValue = sessionCache.get()
console.log(getCacheValue)
sessionCache.remove()