0.7.1 • Published 1 year ago

@susisu/catcher v0.7.1

Weekly downloads
334
License
MIT
Repository
github
Last release
1 year ago

@susisu/catcher

CI

# npm
npm i @susisu/catcher
# yarn
yarn add @susisu/catcher
# pnpm
pnpm add @susisu/catcher

Usage

import { Catcher } from "@susisu/catcher";

const catcher = new Catcher({
  fetcher: () => fetchFromSource(params),
});

// data1 = data fetched from the source
const data1 = await catcher.fetch();

// data2 = cached data equal to data1
const data2 = await catcher.fetch();

// expire the cache
catcher.expire();

// data3 = refetched data from the source
const data3 = await catcher.fetch();

License

MIT License

Author

Susisu (GitHub, Twitter)

0.7.1

1 year ago

0.7.0

1 year ago

0.6.0

3 years ago

0.5.0

4 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

6 years ago

0.1.0

6 years ago