简体   繁体   English

“在同一操作中更改和恢复可观察”是否会触发更新? (暴民)

[英]Does "changing and reverting back observable within the same action" trigger updates? (mobX)

If observable was changed several times within the same action and as result, the observable value equals the initial value (before the action) - does this trigger mobX observable updates?如果 observable 在同一个动作中多次更改,结果是 observable 值等于初始值(在动作之前)——这会触发 mobX observable 更新吗?

I've just tested this - yes, this triggers mobx observable updates.我刚刚对此进行了测试 - 是的,这会触发 mobx 可观察更新。 React components are re-rendered, so the observable is treated as changed. React 组件被重新渲染,因此 observable 被视为已更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM