- Issue created by @brianperry
We're working on introducing an option to disable the cache for individual get requests. This made me think that we may also want to have a way to update the cache with the result of a new fetch.
Looking for a comparable API I found that Apollo Client has an evict method. Might be worth looking for a few alternatives, but on first glance this seems like a decent approach.
And having an evict method would make something like a 'refresh' request much easier. I think that should probably be a follow up issue though.
* Make a cached request.
* You're stuck with it forever :) Technically it might be possible to use cache.set to remove an entry, but we can provide a better API than that.
* Update the API Client Cache Type to include an optional `evict` method that accepts a key as a parameter.
* Update the defaultCache implementation in the utilities package to include an evict method. This method will remove the value stored at the provided cache key.
* Implement changes to ApiClient types.
* Implement changes to defaultCache in utilities package.
* Add test coverage.
* Update documentation.
* Cache interface will accept an optional evict method.
Active
Code