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

Subscriptions are out

One approach to handling data that changes is to observe it. This means using some mechanism to attach a listener callback function that's called whenever the data changes. For example, you could have data that models a user interface component, and when that data changes, you would render the component so that it reflects the changed data.

To set up subscriptions like this will require data that can change, which we don't want. Since we're working with immutable data that never changes, subscriptions are a dead end. This means that you have to rethink your approach for notifying components about the state of your data. The rule of thumb with immutable architectures is that only new data is passed around when things change.

主站蜘蛛池模板: 梅河口市| 太谷县| 榆社县| 壶关县| 厦门市| 奉贤区| 盐城市| 中超| 哈巴河县| 松桃| 汶川县| 上虞市| 阿图什市| 白银市| 横山县| 蒙山县| 叙永县| 宁波市| 八宿县| 广饶县| 湾仔区| 枝江市| 保定市| 寻乌县| 鄯善县| 南平市| 息烽县| 论坛| 嘉荫县| 邵武市| 宜黄县| 朝阳县| 东山县| 克山县| 南京市| 新巴尔虎右旗| 凤庆县| 新源县| 张家口市| 涡阳县| 舞钢市|