memoize-promise-fn
v1.1.1
Published
A utility to cache api calls in JavaScript by memoizing promises
Downloads
6
Maintainers
Readme
memoize-promise-fn
A utility to cache api calls in JavaScript by memoizing promises.
Installation
npm install --save memoize-promise-fn
yarn add memoize-promise-fn
Usage
import memoizePromiseFn from 'memoize-promise-fn';
let cachedFetchData = memoizePromiseFn(fetchData);
Demo
Codesandbox - https://codesandbox.io/s/memoize-promise-fn-demo-468rks?file=/src/lib/index.js
Deployed in Vercel - https://memoize-promise-fn.vercel.app/