-
-
Notifications
You must be signed in to change notification settings - Fork 280
feat: support useWatch #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/field-form/7gSzrozocseGzRSBtT4HUMa7gaaw |
Codecov Report
@@ Coverage Diff @@
## master #413 +/- ##
=======================================
Coverage 99.90% 99.90%
=======================================
Files 15 16 +1
Lines 1067 1111 +44
Branches 226 231 +5
=======================================
+ Hits 1066 1110 +44
Misses 1 1
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
| } | ||
| } | ||
|
|
||
| this.notifyWatch([namePath]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的 notifyWatch 感觉位置不太对。。是不是该跟着 updateStore 后面?
或者有没有可能可以把 notifyWatch notifyObservers updateStore 合成一个方法?逻辑上应该是串联的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本来可以把 notifyWatch 放到 notifyObservers 里,但是还有一点点不同,所以区分开了。不然也容易混乱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MadCcc OK 不?~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉上问题不大,setState 相同 value 也不会触发 render
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
会有一次缓存问题(会多 render 一次),明天再看看
follow up #405
close #405