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

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.

主站蜘蛛池模板: 集安市| 巴楚县| 简阳市| 古丈县| 德安县| 金塔县| 南华县| 安丘市| 阿勒泰市| 高密市| 铜梁县| 灯塔市| 昆明市| 浮梁县| 革吉县| 巴彦县| 开阳县| 沙田区| 洪泽县| 黎川县| 永宁县| 喀喇沁旗| 长沙市| 韶关市| 从化市| 浏阳市| 鹰潭市| 建阳市| 周宁县| 霍州市| 河北区| 晋中市| 三河市| 常山县| 内丘县| 广丰县| 通州区| 阜新| 凤山县| 旅游| 耿马|