kbfetch 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
### 使用示例
|
|
2
2
|
|
|
3
3
|
发起 GET 请求的示例:
|
|
4
4
|
|
|
5
5
|
```javascript
|
|
6
6
|
import kbfetch from 'kbfetch'
|
|
7
|
-
kbfetch.
|
|
7
|
+
kbfetch.get('https://api.example.com/data', { id: 1 })
|
|
8
8
|
// OR
|
|
9
|
-
kbfetch.
|
|
9
|
+
kbfetch.g('https://api.example.com/data', {
|
|
10
10
|
params: { id: 1 }
|
|
11
|
+
// 其他kbFetchInit属性
|
|
11
12
|
})
|
|
12
13
|
```
|
|
13
14
|
|
|
@@ -30,7 +31,7 @@ const ft = kbfetch.g('https://api.example.com/data', { params: { id: 1 }, timeou
|
|
|
30
31
|
ft.abort()
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
### 自定义选项
|
|
34
35
|
|
|
35
36
|
`KbFetchInit` 类型扩展了标准的 `RequestInit`,添加了一些可选的便捷属性:
|
|
36
37
|
|