From 95f4137cfd7f2204630ac9004f98c0809e438ccb Mon Sep 17 00:00:00 2001 From: arthurfiorette Date: Thu, 20 Jan 2022 08:52:44 -0300 Subject: [PATCH] docs: updated docs --- docs/pages/usage-examples.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/pages/usage-examples.md b/docs/pages/usage-examples.md index 47ae36c..ce0339d 100644 --- a/docs/pages/usage-examples.md +++ b/docs/pages/usage-examples.md @@ -73,9 +73,8 @@ const { setupCache } = require('axios-cache-interceptor'); const api = setupCache( Axios.create({ baseURL: 'https://jsonplaceholder.typicode.com/' }), - { - ttl: 5 * 1000 // 5 seconds - } + // 5 seconds + { ttl: 5 * 1000 } ); // Every time an api call reaches here, it will @@ -130,7 +129,10 @@ function Component() { // React component state (but can be from any other framework, library and etc) const [data, setData] = useState(null); - // Calling this function every component redraw does not have any problems. As the response is cached in the first request. This even work with concurrent requests and for many components at the same time + // Calling this function every component redraw does not have any + // problems, as the response is cached in the first request. This + // even work with concurrent requests and for many components at + // the same time axios.get('https://api.example.com').then((response) => { setData(response.data); });