lisaogren / axios-cache-adapter

Caching adapter for axios. Store request results in a configurable store to prevent unneeded network requests.
MIT License
726 stars 107 forks source link

fix(exclude): only cache get requests by default, add config.exclude.methods option #232

Closed ghost closed 3 years ago

ghost commented 3 years ago

Fixes #230

codecov[bot] commented 3 years ago

Codecov Report

Merging #232 (756839d) into master (d5b317e) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #232   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          230       233    +3     
=========================================
+ Hits           230       233    +3     
Impacted Files Coverage Δ
src/request.js 100.00% <ø> (ø)
src/cache.js 100.00% <100.00%> (ø)
src/config.js 100.00% <100.00%> (ø)
src/exclude.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d5b317e...756839d. Read the comment docs.

timtucker commented 3 years ago

Noticed a problem with this -- while the documentation states that methods has a default value, it's specified in the typing for IAxiosCacheAdapterOptions as a mandatory field.

It looks like it was intended to be optional (which would make sense for backward compatibility with old configs)

ghost commented 3 years ago

Fix released https://github.com/RasCarlito/axios-cache-adapter/releases/tag/2.7.2 🙂