Skip to content

Commit

Permalink
📝 Update README.md (#77)
Browse files Browse the repository at this point in the history
Make it clear that throttling only applies to GET.
  • Loading branch information
kevindigo authored Jul 22, 2020
1 parent e5fec2a commit 4912d4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A non-invasive, simple, reliable collection of axios extension
*Not working with axios v0.19.0 as its custom config bug, See https://github.com/axios/axios/pull/2207.*

* [cacheAdapterEnhancer](#cacheadapterenhancer) makes request cacheable
* [throttleAdapterEnhancer](#throttleadapterenhancer) makes request throttled automatically
* [throttleAdapterEnhancer](#throttleadapterenhancer) makes GET requests throttled automatically
* [retryAdapterEnhancer](#retryadapterenhancer) makes request retry with special times while it failed

## Installing
Expand Down Expand Up @@ -164,7 +164,7 @@ http.get('/users', { cache: cacheA, forceUpdate: true });

### throttleAdapterEnhancer

> Throttle requests most once per threshold milliseconds
> Throttle GET requests most once per threshold milliseconds
```ts
throttleAdapterEnhancer(adapter: AxiosAdapter, options: Options): AxiosAdapter
Expand All @@ -178,6 +178,7 @@ Where `adapter` is an axios adapter which following the [axios adapter standard]
| cache | CacheLike |<pre>new LRUCache({ max: 10 })</pre> | CacheLike instance that will be used for storing throttled requests |

Basically we recommend using the `throttleAdapterEnhancer` with `cacheAdapterEnhancer` together for the maximum caching benefits.
Note that POST and other methods besides GET are not affected.

```js
throttleAdapterEnhancer(cacheAdapterEnhancer(axios.defaults.adapter))
Expand Down

0 comments on commit 4912d4c

Please sign in to comment.