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