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

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.

主站蜘蛛池模板: 田林县| 峨眉山市| 宁远县| 乌兰察布市| 稻城县| 高唐县| 鄂托克旗| 五莲县| 无棣县| 大兴区| 桂阳县| 军事| 大英县| 定南县| 青龙| 田东县| 雅江县| 三亚市| 满城县| 保靖县| 哈巴河县| 平南县| 岳普湖县| 瑞安市| 政和县| 尼玛县| 巩留县| 南京市| 泉州市| 德庆县| 彩票| 湖州市| 青河县| 灵山县| 湖口县| 通榆县| 青铜峡市| 昌邑市| 镇江市| 武清区| 昌黎县|