Skip to content

Commit

Permalink
readme fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
krutoo committed Sep 2, 2021
1 parent 1a11a4a commit 2c759fc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ const api = create({
});

// add middleware if you want
api.use(async (requestConfig, next) => {
api.use(async (config, next, defaults) => {
// do something before request start...

await next(requestConfig); // calling next is required
// ...can use axios instance.defaults...
console.log('baseURL:', defaults.baseURL);

await next(config); // calling next is required

// ...and do something after
});
Expand Down

0 comments on commit 2c759fc

Please sign in to comment.