Skip to content

Commit f5b5c89

Browse files
committed
docs: update README
1 parent 255fccb commit f5b5c89

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

README.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22

3-
<h1>kinka + serializy</h1>
3+
<h1>axios + serializy</h1>
44

55
[![](https://img.shields.io/badge/license-MIT-red.svg)](./LICENSE)
66
[![](https://img.shields.io/npm/v/axios-serializy.svg)](https://www.npmjs.com/package/axios-serializy)
@@ -21,18 +21,13 @@
2121
# or using yarn
2222
$ yarn add axios-serializy
2323

24-
<!-- ## 📚 Usage -->
25-
26-
<!-- ```js
27-
import kinka from 'kinka'
28-
import axiosSerializy from 'axios-serializy'
24+
## 📚 Usage
2925

26+
```js
27+
import axios from 'axios-serializy'
3028

31-
const api = kinka.create({
32-
baseURL: 'https://your-api.com',
33-
middlewares: [
34-
axiosSerializy
35-
]
29+
const api = axios.create({
30+
baseURL: 'https://your-api.com'
3631
})
3732

3833
// ...
@@ -44,20 +39,17 @@ const { data } = await api.get('/client/1234', {
4439
console.log(data) // your serialized client model
4540
```
4641

47-
Also if you want to serialize error messages from server you need to:
42+
Also if you want to serialize error messages from server you need to call `axios.setErrorModel(Model)`
43+
Before creating axios instance
4844

4945
```js
46+
axios.setErrorModel(YourPrettifiedErrorModel)
5047

51-
const api = kinka.create({
52-
baseURL: 'https://your-api.com',
53-
middlewares: [
54-
axiosSerializy({
55-
errorModel: YourPrettifiedErrorModel
56-
})
57-
]
48+
const api = axios.create({
49+
baseURL: 'https://your-api.com'
5850
})
5951

60-
``` -->
52+
```
6153

6254

6355
## 📝 License

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "axios-serializy",
33
"version": "0.0.1",
44
"license": "MIT",
5-
"description": "integration kinka with serializy",
5+
"description": "integration axios with serializy",
66
"main": "lib/axios-serializy.js",
77
"unpkg": "dist/axios-serializy.js",
88
"module": "es/axios-serializy.js",

0 commit comments

Comments
 (0)