Repository: alibaba/hooks
Pull request #1078 (2021-07-31 16:16:31)

feat: useLatest translation
<!--
First of all, thank you for your contribution! 😄

New feature please send a pull request to next branch, and rest to master branch.
Pull requests will be merged after one of the collaborators approve.
Please makes sure that these forms are filled before submitting your pull request, thank you!
-->

[[中文版模板 / Chinese template](https://github.com/alibaba/hooks/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)]

### 🤔 This is a ...

- [ ] New feature
- [ ] Bug fix
- [x] Site / documentation update
- [ ] Demo update
- [ ] TypeScript definition update
- [ ] Bundle size optimization
- [ ] Performance optimization
- [ ] Enhancement feature
- [ ] Internationalization
- [ ] Refactoring
- [ ] Code style optimization
- [ ] Test Case
- [ ] Branch merge
- [ ] Other (about what?)

### 🔗 Related issue link

<!--
1. Describe the source of requirement, like related issue link.
-->

### 💡 Background and solution

<!--
1. Describe the problem and the scenario.
2. GIF or snapshot should be provided if includes UI/interactive modification.
3. How to fix the problem, and list final API implementation and usage sample if that is a new feature.
-->

### 📝 Changelog

<!--
Describe changes from the user side, and list all potential break changes or other risks.
--->

| Language   | Changelog |
| ---------- | --------- |
| 🇺🇸 English |           |
| 🇨🇳 Chinese |           |

### ☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

- [x] Doc is updated/provided or not needed
- [x] Demo is updated/provided or not needed
- [x] TypeScript definition is updated/provided or not needed
- [x] Changelog is provided or not needed



Patch:
diff --git a/packages/hooks/src/useBoolean/demo/demo1.tsx b/packages/hooks/src/useBoolean/demo/demo1.tsx
index 30dad01c..b50a1157 100644
--- a/packages/hooks/src/useBoolean/demo/demo1.tsx
+++ b/packages/hooks/src/useBoolean/demo/demo1.tsx
@@ -1,5 +1,5 @@
 /**
- * title: Default usage
+ * title: Basic usage
  * desc: Toggle boolean, default value can be set optionally.
  *
  * title.zh-CN: 基础用法
diff --git a/packages/hooks/src/useInterval/demo/demo1.tsx b/packages/hooks/src/useInterval/demo/demo1.tsx
index 0c844b6c..c680ba85 100644
--- a/packages/hooks/src/useInterval/demo/demo1.tsx
+++ b/packages/hooks/src/useInterval/demo/demo1.tsx
@@ -1,6 +1,6 @@
 /**
- * title: Default usage
- * desc: Every 1000ms, execute once
+ * title: Basic usage
+ * desc: Execute once per 1000ms.
  *
  * title.zh-CN: 基础用法
  * desc.zh-CN: 每1000ms，执行一次
diff --git a/packages/hooks/src/useInterval/demo/demo3.tsx b/packages/hooks/src/useInterval/demo/demo3.tsx
index 47340c3a..624e8a9a 100644
--- a/packages/hooks/src/useInterval/demo/demo3.tsx
+++ b/packages/hooks/src/useInterval/demo/demo3.tsx
@@ -1,6 +1,6 @@
 /**
  * title: Manual Control
- * desc: controll interval status manually
+ * desc: Control interval status manually
  *
  * title.zh-CN: 手动控制
  * desc.zh-CN: 手动控制定时器状态
diff --git a/packages/hooks/src/useInterval/index.en-US.md b/packages/hooks/src/useInterval/index.en-US.md
index ffe34a85..83db9bc2 100644
--- a/packages/hooks/src/useInterval/index.en-US.md
+++ b/packages/hooks/src/useInterval/index.en-US.md
@@ -12,7 +12,7 @@ group:
 
 <Tag lang="en-US" tags="ssr&crossPlatform"></Tag>
 
-A hook that can handle the setInterval timer function.
+A hook that handles the `setInterval` timer function.
 
 ## Examples
 
@@ -38,13 +38,13 @@ useInterval(
 
 | Property | Description                                                                                                                             | Type       |
 |----------|-----------------------------------------------------------------------------------------------------------------------------------------|------------|
-| fn       | The function to setInterval                                                                                                             | `() => void` |
-| delay    | The timer should delay in between executions of the specified function or code. If delay is `null` or `undefined`, the timer will stop. |    `number` \| `undefined` \| `null`        |
-| options  | Config the interval behavior. See the Options section below                                                                             | `Options`    |
+| fn       | The function to be executed every `delay` milliseconds.                                                                                 | `() => void` |
+| delay    | The time in milliseconds, the timer should delay in between executions of the specified function. The timer will be cancelled if delay is set to `null` or `undefined`. |  `number` \| `undefined` \| `null` |
+| options  | Config of the interval behavior. See the `Options` section below for more information.                                                  | `Options`    |
 
 
 ### Options
 
 | Property  | Description                                           | Type    | Default |
 |-----------|-------------------------------------------------------|---------|---------|
-| immediate | Whether it is executed immediately for the first time | `boolean` | `false`   |
+| immediate | Whether the passed-in function should be executed immediately on first execution | `boolean` | `false`   |
diff --git a/packages/hooks/src/useToggle/demo/demo1.tsx b/packages/hooks/src/useToggle/demo/demo1.tsx
index a0837972..1f8a5ba2 100644
--- a/packages/hooks/src/useToggle/demo/demo1.tsx
+++ b/packages/hooks/src/useToggle/demo/demo1.tsx
@@ -1,5 +1,5 @@
 /**
- * title: Default usage
+ * title: Basic usage
  * desc: Default value is boolean，alike useBoolean.
  *
  * title.zh-CN: 基础用法


Test patch:
diff --git a/packages/hooks/src/useLatest/demo/demo1.tsx b/packages/hooks/src/useLatest/demo/demo1.tsx
index 5a2ba17f..1d9f6ed2 100644
--- a/packages/hooks/src/useLatest/demo/demo1.tsx
+++ b/packages/hooks/src/useLatest/demo/demo1.tsx
@@ -1,6 +1,6 @@
 /**
  * title: Basic usage
- * desc: useLatest return the latest value
+ * desc: useLatest always returns the latest value
  *
  * title.zh-CN: 基础用法
  * desc.zh-CN: useLatest 返回的永远是最新值
diff --git a/packages/hooks/src/useLatest/index.en-US.md b/packages/hooks/src/useLatest/index.en-US.md
index f7dcfa6b..9230a856 100644
--- a/packages/hooks/src/useLatest/index.en-US.md
+++ b/packages/hooks/src/useLatest/index.en-US.md
@@ -12,7 +12,7 @@ group:
 
 <Tag lang="en-US" tags="ssr&crossPlatform"></Tag>
 
-The Hook that returns the latest value, can avoid the closure problem.
+A Hook that returns the latest value, effectively avoiding the closure problem.
 
 ## Examples