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

mobx中autorun的触发顺序 #147

Open
ckinmind opened this issue Feb 2, 2018 · 2 comments
Open

mobx中autorun的触发顺序 #147

ckinmind opened this issue Feb 2, 2018 · 2 comments

Comments

@ckinmind
Copy link
Owner

ckinmind commented Feb 2, 2018

做项目的时候遇到一个问题,有一个全局的值分别有两个地方用autorun监听这个值的变动,那么这个监听触发的顺序的先后是什么,这个两个地方(react环境)如果是兄弟组件, 父子组件,这个顺序会怎么样

@exoticknight
Copy link

no guarantee
ref: mobxjs/mobx#686

@ckinmind
Copy link
Owner Author

@exoticknight 感谢, 我自己测试的结果似乎在父子组件中监听同一个值,父组件的autorun会先触发

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

No branches or pull requests

2 participants