Skip to content
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

Update computeds-with-args.md #157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/computeds-with-args.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Item = observer(({ item, store }) => {
我们在对observable的reaction中间加入了一段新的计算值。
这样的逻辑是可以正确允许,并且会带来额外的值缓存,从而避免组件直接对每一个选择框的行为作出反馈。这种做法的优势是,只有在`isSelected` 状态变化时,组件本身才会重渲染。这里也就是我们需要重新渲染来替换 `className`

事实是即便我们在下一次渲染时创建了新的 `computed` 也没有问题,新创的建计算值会成为新的缓存点而前一个则会被清理掉
事实是即便我们在下一次渲染时创建了新的 `computed` 也没有问题,新创建的计算值会成为新的缓存点而前一个则会被清理掉
这是一个很棒的高级优化技巧。

## 3. 调整状态
Expand Down