2.0.4 • Published 10 months ago

@smart-code/data-center v2.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

提供数据代理

🏗 安装

# npm install
$ npm install @smart-code/data-center --save

# yarn install
$ yarn add @smart-code/data-center

# pnpm install
$ pnpm i @smart-code/data-center

🔨 使用

import { createStorePro } from '@smart-code/data-center';

const store = createStorePro<number>(
  {
    fetch: async function fetch() {
      return await Promise.resolve(30);
    },
  },
);

await store.set('total', 0);
const data = await store.get('total'); // 0
const uptodateData = await store.get('total', { uptodate: true }); // 30
const cacheData = await store.getHistory(); // [0, 30]
2.0.4

10 months ago

2.0.3

10 months ago

2.0.2

10 months ago

2.0.1

10 months ago

2.0.0

10 months ago