Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lei1248276/uni-use-cache

uni-app 获取缓存数据,修改数据会自动更新缓存
https://github.com/lei1248276/uni-use-cache

cache storage typescript uni-api uni-app

Last synced: about 2 months ago
JSON representation

uni-app 获取缓存数据,修改数据会自动更新缓存

Awesome Lists containing this project

README

        

# uni-use-cache
- uni-app 获取缓存数据,修改数据会自动更新缓存(默认为异步获取缓存数据)

## Install
```bash
pnpm add uni-use-cache
```
```bash
yarn add uni-use-cache
```
```bash
npm install uni-use-cache
```

## Usage
```typescript
import useCache from 'uni-use-cache'
const data = useCache('key', ref())
const data1 = useCache('key1', ref(), true)
const data2 = useCache('key2', reactive({}))
```