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

  • MobX Quick Start Guide
  • Pavan Podila Michel Weststrate
  • 133字
  • 2021-08-05 10:34:23

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.

主站蜘蛛池模板: 黔西| 平山县| 贵南县| 玛多县| 五峰| 昭通市| 德化县| 新津县| 凤台县| 海丰县| 东辽县| 颍上县| 泾阳县| 屏东市| 昌邑市| 都昌县| 镇平县| 房产| 囊谦县| 岳阳市| 肇东市| 和顺县| 龙南县| 新沂市| 扎囊县| 垦利县| 永德县| 专栏| 湘潭市| 中超| 锡林浩特市| 泉州市| 景洪市| 渝中区| 邢台县| 巴林右旗| 玛沁县| 浏阳市| 陆良县| 中西区| 溧阳市|