- 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.
推薦閱讀
- LaTeX Cookbook
- Java異步編程實戰
- Power Up Your PowToon Studio Project
- 無代碼編程:用云表搭建企業數字化管理平臺
- iOS開發實戰:從零基礎到App Store上架
- Learning Apache Mahout Classification
- 深入淺出Serverless:技術原理與應用實踐
- 寫給程序員的Python教程
- Mastering Apache Storm
- Java語言程序設計實用教程(第2版)
- Mastering Machine Learning with R
- Unity 5 Game Optimization
- LabVIEW數據采集(第2版)
- Oracle Database 12c DBA官方手冊(第8版)
- Mastering PostgreSQL 11(Second Edition)