Skip to content

Commit

Permalink
update README_zh-CN
Browse files Browse the repository at this point in the history
  • Loading branch information
SmilingXinyi committed Aug 7, 2019
1 parent be51abb commit ce4fd51
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,33 @@ Fetch-based front-end middleware development model
npm install --save @misaka.ink/fetch2
```

## 使用方法

## 中间件

##### 使用中间件

```javascript
import fetch2, {method} from '@misaka.ink/fetch2'
import middleware from 'middleware'
const f2 = fetch2.getInstance()

f2.use(middleware)
```

## 错误信息

- name: 错误名称 - **FetchError**
- message: 错误消息 - **{error message}**
- stack: 错误堆栈 - **{stack}**
- info: 保留信息 - **reservation infomation**

##### 自定义中间件开发

```javascript

```

## 例子

##### 初始化
Expand Down Expand Up @@ -132,16 +152,6 @@ async function func() {
}
```

##### 使用中间件

```javascript
import fetch2, {method} from '@misaka.ink/fetch2'
import middleware from 'middleware'
const f2 = fetch2.getInstance()

f2.use(middleware)
```

##### 失败时重复请求

```javascript
Expand Down

0 comments on commit ce4fd51

Please sign in to comment.