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

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.

主站蜘蛛池模板: 德江县| 渭南市| 当涂县| 舞阳县| 延津县| 沙湾县| 南平市| 尼木县| 东宁县| 新化县| 论坛| 邛崃市| 伊金霍洛旗| 大冶市| 庆阳市| 大港区| 诸城市| 普宁市| 红原县| 兴义市| 利川市| 赣州市| 桦南县| 介休市| 佛教| 邵阳县| 驻马店市| 莱西市| 仁化县| 崇州市| 阿巴嘎旗| 体育| 平果县| 内乡县| 清苑县| 汶川县| 高雄县| 和田市| 茂名市| 阿拉尔市| 泰安市|