node-ts-cache icon indicating copy to clipboard operation
node-ts-cache copied to clipboard

How to clear cache for a single item?

Open MickL opened this issue 3 years ago • 3 comments

I found there is a function clear() and expect it to clear the full cache. But how to I clear the cache only for a single value?

If this is not integrated please consider it as a feature request.

myCache.clearItem('key');

MickL avatar Aug 11 '22 11:08 MickL

@MickL what about unsetKey()?

havsar avatar Aug 11 '22 15:08 havsar

I didnt see that method as it is not documented. Anyway I cant use it because it is set to private. Also it doesnt even seem to be a method that accepts a string:

Bildschirmfoto 2022-08-11 um 17 44 05

MickL avatar Aug 11 '22 15:08 MickL

@MickL Adding this improvement to the next minor version. Probably during next week.

havsar avatar Aug 12 '22 14:08 havsar

Including this in the next release (v5).

havsar avatar Dec 29 '22 08:12 havsar