@chenzoho/cache

1.0.3 • Public • Published

缓存组件

安装

pnpm i xe-utils
pnpm i @chenzoho/crypto
pnpm i @chenzoho/cache

注册

import { setupCache,toggleCache } from "@chenzoho/cache"

setupCache(/** prefixKey */,/**timeout */,/**local */,/**hasEncrypt */)

使用

import { persist } from "@chenzoho/cache"

// 内存
persist.memoryStorage.get(/** key */)

// 本地
persist.lsStorage.get(/** key */)

// 会话
persist.ssStorage.get(/** key */)

// 混合
persist.mixinStorage.get(/** key */)

// 本地内存混合
persist.lsMixin.get(/** key */)

// 本地会话混合
persist.ssMixin.get(/** key */)

更新

  • 1.0.0
    • 初始版本
  • 1.0.1
    • 增加
      • 是否加密的选项
    • 移除
      • 切换的方法toggleCache
  • 1.0.2
    • 移除
      • src文件夹
    • 修复
      • README.md

Package Sidebar

Install

npm i @chenzoho/cache

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

38.7 kB

Total Files

10

Last publish

Collaborators

  • dingyy
  • chenzehong