Hi, great module!
I found interesting bug with pMemoizeClear
and cache.
Here is example:
import ExpiryMap from 'expiry-map'; // [email protected]
import pMemoize, { pMemoizeClear } from 'p-memoize'; // [email protected]
const memoizedFn = pMemoize(async (str) => str, {
cache: new ExpiryMap(10000),
});
await memoizedFn('something');
const [value] = await Promise.all([
memoizedFn('something'),
pMemoizeClear(memoizedFn),
]);
console.log(value); // undefined
It's connected with these two lines
Lines 104 to 105 in 52fe605
await
in if
condition, result will be something
as expected.
I'm not sure how to fix this issue, perhaps you have better ideas than me π
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too