const memoizedGot = pMemoize(got);
await memoizedGot('https://sindresorhus.com');
// This call is cached
await memoizedGot('https://sindresorhus.com');
await delay(2000);
// This call is not cached as the cache has expired
await memoizedGot('https://sindresorhus.com');
I think this is miss-leading (as far as I understood it) since the default cache that is used here it's not time-based (or at least should never expire with Number.POSITIVE_INFINITY). It requires to pass a different Map as described here.
In the README file the first example implies that the last call won't be memoized since the cache is expired (https://github.com/sindresorhus/p-memoize/blob/main/readme.md?plain=1#L35)
I think this is miss-leading (as far as I understood it) since the default cache that is used here it's not time-based (or at least should never expire with
Number.POSITIVE_INFINITY
). It requires to pass a different Map as described here.Am I miss something here?