Skip to content

Commit

Permalink
axios upd
Browse files Browse the repository at this point in the history
- axios package version updated to 1.1.3
- some style fixes in example app
  • Loading branch information
krutoo committed Oct 24, 2022
1 parent 981a3f6 commit cb1a989
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 61 deletions.
6 changes: 3 additions & 3 deletions example/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { create } from '../../src/index.ts';

const api = create({
const client = create({
baseURL: 'https://jsonplaceholder.typicode.com/',
timeout: 5000,
});

api
client
.use(async (config, next) => {
Logger.print('middleware #1:before');
const startTime = performance.now();
Expand Down Expand Up @@ -53,7 +53,7 @@ const Logger = {
async function performXHR() {
Logger.print('before calling request');

await api.get('/posts', {
await client.get('/posts', {
params: {
userId: 2,
},
Expand Down
145 changes: 90 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@
},
"homepage": "https://github.com/krutoo/middleware-axios#readme",
"peerDependencies": {
"axios": "^0.24.0"
"axios": "^1.1.3"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@babel/preset-typescript": "^7.15.0",
"@types/axios": "^0.14.0",
"@types/jest": "^27.0.3",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"axios": "0.24.0",
"axios": "^1.1.3",
"babel-jest": "^27.4.5",
"eslint": "^8.4.1",
"husky": "^7.0.0",
Expand Down

0 comments on commit cb1a989

Please sign in to comment.