Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 获取缓存数据,修改数据会自动更新缓存
- Host: GitHub
- URL: https://github.com/lei1248276/uni-use-cache
- Owner: lei1248276
- License: mit
- Created: 2024-08-28T11:03:39.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-28T11:04:05.000Z (4 months ago)
- Last Synced: 2024-10-31T15:47:16.494Z (2 months ago)
- Topics: cache, storage, typescript, uni-api, uni-app
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/uni-use-cache
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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({}))
```