Skip to content

Commit

Permalink
docs: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Jan 20, 2022
1 parent b76087e commit 95f4137
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/pages/usage-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 95f4137

Please sign in to comment.