diff --git a/packages/hooks/src/useRequest/doc/polling/polling.en-US.md b/packages/hooks/src/useRequest/doc/polling/polling.en-US.md index 495b46706c..56c69db578 100644 --- a/packages/hooks/src/useRequest/doc/polling/polling.en-US.md +++ b/packages/hooks/src/useRequest/doc/polling/polling.en-US.md @@ -58,4 +58,5 @@ You can experience the effect through the following example. - `options.pollingInterval`, `options.pollingWhenHidden` support dynamic changes. - If you set `options.manual = true`, the initialization will not start polling, you need start it by `run/runAsync`. +- If the `pollingInterval` changes from 0 to a value greater than 0, polling will not start automatically, and you need start it by `run/runAsync`. - The polling logic is to wait for `pollingInterval` time after each request is completed, and then initiate the next request. diff --git a/packages/hooks/src/useRequest/doc/polling/polling.zh-CN.md b/packages/hooks/src/useRequest/doc/polling/polling.zh-CN.md index b043adf048..b124f49d02 100644 --- a/packages/hooks/src/useRequest/doc/polling/polling.zh-CN.md +++ b/packages/hooks/src/useRequest/doc/polling/polling.zh-CN.md @@ -50,7 +50,7 @@ const { data, run, cancel } = useRequest(getUsername, { | 参数 | 说明 | 类型 | 默认值 | | ---------------------- | ------------------------------------------------------------------------------------------------------ | --------- | ------ | -| pollingInterval | 轮询间隔,单位为毫秒。如果值大于 0,则启动轮询模式。 | `number` | `0` | +| pollingInterval | 轮询间隔,单位为毫秒。如果值大于 0,则处于轮询模式。 | `number` | `0` | | pollingWhenHidden | 在页面隐藏时,是否继续轮询。如果设置为 false,在页面隐藏时会暂时停止轮询,页面重新显示时继续上次轮询。 | `boolean` | `true` | | pollingErrorRetryCount | 轮询错误重试次数。如果设置为 -1,则无限次 | `number` | `-1` | @@ -58,4 +58,5 @@ const { data, run, cancel } = useRequest(getUsername, { - `options.pollingInterval`、`options.pollingWhenHidden` 支持动态变化。 - 如果设置 `options.manual = true`,则初始化不会启动轮询,需要通过 `run/runAsync` 触发开始。 +- 如果设置 `pollingInterval` 由 `0` 变成 `大于 0` 的值,不会启动轮询,需要通过 `run/runAsync` 触发开始。 - 轮询原理是在每次请求完成后,等待 `pollingInterval` 时间,发起下一次请求。