@ematipico/runner
v1.0.2
Published
Run concurrent async operations and cache them
Downloads
5
Readme
Runner
Handles multiple async operations with caching
Installation
With yarn
yarn add @ematipico/runner
With npm
npm i -D @ematipico/runner
Usage
import createRunner from '@ematipico/runner';
const runner = createRunner();
const getPosts = fetch('https://url/to/posts');
const getPosts2 = fetch('https://url/to/posts');
const result = runner.run(getPosts);
const result2 = runner.run(getPosts2); // the async operation gets run once