Skip to content

Commit

Permalink
doc: add run return doc
Browse files Browse the repository at this point in the history
  • Loading branch information
brickspert committed Feb 20, 2020
1 parent e868010 commit 8ba0188
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"del": "^5.1.0",
"enzyme": "^3.10.0",
"father": "^2.13.3",
"father-doc": "^1.0.0-alpha.19",
"father-doc": "1.0.0-alpha.19",
"lerna": "^3.20.2",
"mockjs": "^1.1.0",
"now": "^16.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/use-request/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const {
| data | <ul><li> Data returned by the service。</li><li> If `formatResult` is set, the data will be the return of `formatResult`. </li></ul> | `undefined / any` |
| error | exception thrown by service, default is `undefined` | `undefined / Error` |
| loading | Whether the service is loaded | `boolean` |
| run | Manually trigger the service execution. Its parameters will be passed to the service function | `(...args: any[]) => Promise` |
| run | <ul><li>Manually trigger the service execution. Its parameters will be passed to the service function. </li><li>In Debounce or Throttle mode, will return `Promise<null>`</li></ul> | `(...args: any[]) => Promise` |
| params | An array of parameters for the service being executed. For example, you triggered `run (1, 2, 3)`, then params is equal to [[1, 2, 3] ` | `any[]` |
| cancel | <ul><li>Cancel the current running request </li><li>This will also stop the polling. </li></ul> | `() => void` |
| refresh | Using the last params, re-execute the service | `() => Promise` |
Expand Down
2 changes: 1 addition & 1 deletion packages/use-request/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const {
| data | <ul><li> service 返回的数据,默认为 `undefined`。</li><li> 如果有 `formatResult`, 则该数据为被格式化后的数据。</li></ul> | `undefined / any` |
| error | service 抛出的异常,默认为 `undefined` | `undefined / Error` |
| loading | service 是否正在执行 | `boolean` |
| run | 手动触发 service 执行,参数会传递给 service | `(...args: any[]) => Promise` |
| run | <ul><li>手动触发 service 执行,参数会传递给 service</li><li>debounce 模式与 throttle 模式返回值为 `Promise<null>`</li></ul> | `(...args: any[]) => Promise` |
| params | 当次执行的 service 的参数数组。比如你触发了 `run(1, 2, 3)`,则 params 等于 `[1, 2, 3]` | `any[]` |
| cancel | <ul><li>取消当前请求 </li><li>如果有轮询,停止 </li></ul> | `() => void` |
| refresh | 使用上一次的 params,重新执行 service | `() => Promise` |
Expand Down

0 comments on commit 8ba0188

Please sign in to comment.