官术网_书友最值得收藏!

Summary

The UI is the visual equivalent of data (the state) along with interactive controls to change that state. The UI fires actions, which leads to the change in state. Side effects are external operations that are triggered due to some state change. There are observers in the system that look out for certain state changes and perform the corresponding side effects.

The data flow triad of Action --> State --> UI, coupled with side effects, creates a simple mental model of the UI. MobX strongly adheres to this mental model and you can see that reflected in its API, with observables, actions, reactions, and observers. The simplicity of this API makes it easy to tackle some of the complex interactions in UI.

If you have used Redux before, you can see that MobX reduces the ceremony needed to cause a state change and handle side effects. MobX strives to provide a declarative and reactive API for state management without compromising on simplicity. Throughout this book, this philosophy of MobX will be explored, with a deeper look at its API and real-world use cases.

In the next chapter, we will dive into the world of MobX with a first hand look at its core building blocks.

主站蜘蛛池模板: 绥江县| 洛隆县| 冀州市| 建水县| 西藏| 阿尔山市| 深圳市| 富顺县| 托克逊县| 康保县| 长子县| 南丰县| 阿城市| 北票市| 固镇县| 三河市| 剑川县| 襄城县| 余姚市| 鄂伦春自治旗| 马鞍山市| 左云县| 玉树县| 祁阳县| 辽宁省| 清远市| 杭锦后旗| 闽清县| 平果县| 鄂托克前旗| 仪陇县| 饶河县| 安岳县| 额尔古纳市| 永州市| 云浮市| 格尔木市| 涞源县| 五莲县| 南江县| 亚东县|