jaredLunde/react-hook

Add remove method to cache (result of createCache method)

szogun1987 opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
In some cases I would like to mark cache entry as "to reload in next use" so pretty much remove entry.

Describe the solution you'd like
Internal cache's lru already has delete method, please just expose it.

Describe alternatives you've considered
I've considered creating separate cache instance and keep it in component's state but, as this cache is used by multiple components it would be quite complex solution.
Currently I write artificial value into a cache, and detect it when call useCache.

Additional context
None

this seems reasonable