Closed fregante closed 4 years ago
I might need help with the first couple of points in my OP.
@SamVerschueren do you think map-age-cleaner
could work with an async Map
like https://github.com/lukechilds/keyv?
Not out of the box I think because it doesn't await for the methods to complete. Basically it only needs an instance with set
, has
and delete
but all of them are called synchronously.
We can however update map-age-cleaner
so we can do mapAgeCleaner.async(map)
Likewise this change perhaps could just be an option on mem
:
https://github.com/sindresorhus/mem/issues/49#issuecomment-557087637
I was trying to use this in Refined GitHub and soon realized that our forced {data, expiration}
format isn't a great fit for external storage.
I was expecting to find items saved as key: value
but found them as key: {data: value}
. This is (almost) alright when you just use mem
with its default cache
Map, but in this case:
mem
mem
always wraps them into objectscc @sindresorhus
Enables and closes #3
maxAge items are deleted even if function throws
Docs
mem
top-memoize
in docsmem
also onmem
's repo