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

为什么要在watcher.run再检查一次value!==watcher.value? #66

Open
lsycxyj opened this issue Oct 14, 2019 · 0 comments
Open

为什么要在watcher.run再检查一次value!==watcher.value? #66

lsycxyj opened this issue Oct 14, 2019 · 0 comments

Comments

@lsycxyj
Copy link

lsycxyj commented Oct 14, 2019

你好,我阅读vue的源码,发觉在setter已经做了次差值比较,watcher也经过了去重处理,然后却又再watcher.run做了一次新旧值比较(只比对primitive类型),才决定是否执行cb回调。那这个比较会在什么情景下会有用?还是其实基本是多余的?
麻烦指点一下,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant