From 1b7f4e7d879e23c86dc979e9a3ae2a6f9d519648 Mon Sep 17 00:00:00 2001
From: 97vack <1739717921@qq.com>
Date: Mon, 30 Sep 2024 14:48:17 +0800
Subject: [PATCH] docs: modify docs subscribe
---
docs/intro/useSubscribe.md | 6 ++++--
docs/intro/useSubscribe.zh-CN.md | 4 +++-
docs/intro/useWatch.md | 2 ++
docs/intro/useWatch.zh-CN.md | 2 ++
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/docs/intro/useSubscribe.md b/docs/intro/useSubscribe.md
index c587ccb..c62aa28 100644
--- a/docs/intro/useSubscribe.md
+++ b/docs/intro/useSubscribe.md
@@ -9,9 +9,11 @@ toc: content
# Subscribe to latest value
-Using form model data **model** to control form controls through dot assignment. However, this will not cause the entire view to be re-rendered, thus achieving part of the performance optimization. If you directly use model.xx to render the latest value outside the form item, it may not achieve the expected effect.
+Using form model data **model** to control form controls through point assignment. However, this will not cause the entire view to be re-rendered, which means that it cannot be consumed as a state variable externally. This is also part of achieving performance optimization. If you want to directly use model.xx to render the latest value outside the form item, it may not achieve the expected effect.
-Therefore, we can use the **useSubscribe** hook to solve this problem.
+Therefore, we can use **useSubscribe** hook to solve this problem.
+
+**useSubscribe** uses a deep comparison algorithm, which means that as long as the new value and the old value are exactly the same, no matter how deep the hierarchy is, it will not re-render.
### Basic Usage
diff --git a/docs/intro/useSubscribe.zh-CN.md b/docs/intro/useSubscribe.zh-CN.md
index 4dc834a..833ed84 100644
--- a/docs/intro/useSubscribe.zh-CN.md
+++ b/docs/intro/useSubscribe.zh-CN.md
@@ -9,10 +9,12 @@ toc: content
# 订阅最新值
-使用表单模型数据 _model_ 通过点赋值可以对表单控件进行受控。然而,这不会引起整体视图的重新渲染,从而实现性能优化的一部分。如果你直接使用 model.xx 在表单项外部渲染最新的值,它可能无法达到预期的效果。
+使用表单模型数据 _model_ 通过点赋值可以对表单控件进行受控。然而这不会引起整体视图的重新渲染,也就是说在外部无法让它作为一个state状态变量去消费。这也是实现性能优化的一部分。如果你想直接使用 model.xx 在表单项外部渲染最新的值,它可能无法达到预期的效果。
因此,我们可以借助 _useSubscribe_ hook 来解决这个问题。
+_useSubscribe_ 采用深度对比算法,也就是说只要新的value和旧的value不管层级多深只要值完全相同那它就不会re-render。
+
### 基本用法
使用 _useSubscribe_ 订阅某个表单控件的值。
diff --git a/docs/intro/useWatch.md b/docs/intro/useWatch.md
index bd9ee82..20b5b7e 100644
--- a/docs/intro/useWatch.md
+++ b/docs/intro/useWatch.md
@@ -11,6 +11,8 @@ toc: content
**React Form Simple** provides form watch functionality, which is very useful for handling specific logic when certain form fields change.
+**useWatch** uses a deep comparison algorithm, which means that as long as the new value and the old value are exactly the same, no matter how deep the level is, it will not trigger the listener function.
+
### Basic Usage
Use **useWatch** to monitor changes in a specific field.
diff --git a/docs/intro/useWatch.zh-CN.md b/docs/intro/useWatch.zh-CN.md
index 5eaea3f..b23275a 100644
--- a/docs/intro/useWatch.zh-CN.md
+++ b/docs/intro/useWatch.zh-CN.md
@@ -11,6 +11,8 @@ toc: content
_React Form Simple_ 提供表单监听操作,对于在某些表单项字段变化后需要处理特定逻辑的情况非常有用。
+_useWatch_ 采用深度对比算法,也就是说只要新的value和旧的value不管层级多深只要值完全相同那它就不会触发listener函数。
+
### 基本用法
使用 _useWatch_ 监听某个字段的变化。