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

Observables

Data is the lifeblood of your UI. Going back to the equation that defines the relationship between data and UI, we know that the following is true:

So, it makes sense to focus on defining the structure of data that will drive the UI. In MobX, we do this with the observables. Take a look at this diagram:

Observables, as the name suggests, are entities that can be observed. They keep track of changes happening to their values and notify all the observers. This seemingly simple behavior has powerful implications when you start designing the structure of your client-state. In the preceding diagram, every circle represents an Observable, and every diamond is an Observer. An observer can observe one or more observables and get notified when any of them change value.

主站蜘蛛池模板: 富川| 花莲县| 曲水县| 文化| 陈巴尔虎旗| 淄博市| 大余县| 阳曲县| 江油市| 临朐县| 济源市| 若羌县| 兴业县| 北安市| 武宣县| 依安县| 南溪县| 土默特右旗| 云浮市| 丹凤县| 武义县| 平罗县| 大城县| 西平县| 社旗县| 两当县| 象州县| 贡嘎县| 千阳县| 台中县| 诸暨市| 平罗县| 甘泉县| 库车县| 五峰| 永善县| 确山县| 旌德县| 尤溪县| 饶河县| 依安县|