axios-hooks icon indicating copy to clipboard operation
axios-hooks copied to clipboard

Feature Request: Clearing specific cache key

Open vmlopezr opened this issue 2 years ago • 0 comments

When using lru cache, it looks like the config object is stringified for the key.

https://github.com/simoneb/axios-hooks/blob/6f060a20db7cb4ca70bd06315e05ff0a847ebd4d/src/index.js#L48

In my project i have a need to clear the cached value so that i can fetch new items. At the moment the way we're doing this is by purging the entire cache.

Would it be possible to either:

  1. Add a config option for custom cache key, which we can reference easily.
  2. Return a method just like the cancel method, which would clear only the cache key?

vmlopezr avatar Feb 16 '22 02:02 vmlopezr