I've tried to keep the dependency on mem at firt, but I've not found any solution where it would make sense. After I added the maxAge map here to the p-memoize there wasn't basically any reason to keep mem in here. Maybe just for the clear function but in my opinien it is cleaner to have here cacheStore then to have dependency just for that purpose.
The only change is in the maxAge, all other behaviour should be unchanged.
Alltho the code would be cleaner if we would create from every function -> async function but I would rather have a bit more complicated code and keep the behaviour.
Let me know what you think or if you see any other nice, cleaner solutions.
This is PR base on issue https://github.com/sindresorhus/p-memoize/issues/22.
I've tried to keep the dependency on mem at firt, but I've not found any solution where it would make sense. After I added the maxAge map here to the
p-memoize
there wasn't basically any reason to keep mem in here. Maybe just for theclear
function but in my opinien it is cleaner to have herecacheStore
then to have dependency just for that purpose.The only change is in the maxAge, all other behaviour should be unchanged. Alltho the code would be cleaner if we would create from every function -> async function but I would rather have a bit more complicated code and keep the behaviour.
Let me know what you think or if you see any other nice, cleaner solutions.
Fixes #22