- Mastering Immutable.js
- Adam Boduch
- 126字
- 2021-07-08 10:30:04
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.
推薦閱讀
- 程序員面試筆試寶典
- Hands-On JavaScript High Performance
- SharePoint Development with the SharePoint Framework
- Learning Salesforce Einstein
- 基于Struts、Hibernate、Spring架構的Web應用開發
- Odoo 10 Implementation Cookbook
- Getting Started with Nano Server
- 零基礎看圖學ScratchJr:少兒趣味編程(全彩大字版)
- Java Hibernate Cookbook
- 計算語言學導論
- Python編程基礎教程
- Developing Java Applications with Spring and Spring Boot
- Koa與Node.js開發實戰
- INSTANT Apache Maven Starter
- Neo4j權威指南 (圖數據庫技術叢書)