From ec523e85ae1cb9e20aa33f1c0bcb3d6ff5172b35 Mon Sep 17 00:00:00 2001 From: arthurfiorette Date: Mon, 27 Dec 2021 19:11:31 -0300 Subject: [PATCH] docs: updated docs --- README.md | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0f49822..be64b36 100644 --- a/README.md +++ b/README.md @@ -168,16 +168,16 @@ import { createCache } from 'axios-cache-interceptor'; ![Version](https://img.shields.io/npm/v/axios-cache-interceptor?style=flat) ```html - + ``` @@ -197,9 +197,9 @@ by axios was it's types.** | [Version](https://github.com/ArthurFiorette/axios-cache-interceptor/releases) | [Axios](https://github.com/axios/axios/releases) | | ----------------------------------------------------------------------------- | ------------------------------------------------ | -| `~v0.5` | `>= v0.24` | -| `~v0.4` | `>= v0.23` | -| `~v0.3` | `>= v0.22` | +| `>= v0.5` | `>= v0.24` | +| `~ v0.4` | `>= v0.23` | +| `~ v0.3` | `>= v0.22` | | `<= v0.2` | `v0.21` |
@@ -221,19 +221,36 @@ axios = createCache(axios, { }); ``` -After that, you can made your own requests normally. +After that, you can made your own requests normally, as this library respects axios API. + +Afterwards, the only thing you may need to configure is per-request configuration, you can change them with the `cache` property. + +```js +import { createCache } from 'axios-cache-interceptor'; + +// Your axios-cache-interceptor instance +let axios; + +axios.get('url', { + cache: { + /** options here */ + } +}) +``` + +You will get syntax highlighting for all options and what they do. But you can also read here: [Per-request configuration](#per-request-configuration).
## Compiled code As axios itself requires [ES6 Promises](https://axios-http.com/docs/notes#promises), the -CommonsJS module and the Browser minified version are also `>= ES6` compatibles. +CommonsJS module and the UMD module are also `>= ES6` compatibles. You can see more here about compiling options: -- [Browser config](/tsconfig.browser.json) & [Webpack config](/webpack.config.js) -- [NodeJS Config](/tsconfig.build.json) +- `UMD` -> [Browser config](/tsconfig.browser.json) & [Webpack config](/webpack.config.js) +- `CommonsJS` -> [NodeJS Config](/tsconfig.build.json) Don't forget, you can always rebuilt this library by up from it's source code or recompile the dist with lower ecma script versions.