- 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.
推薦閱讀
- 國際大學(xué)生程序設(shè)計競賽中山大學(xué)內(nèi)部選拔真題解(二)
- Node.js Design Patterns
- 實戰(zhàn)低代碼
- YARN Essentials
- Elasticsearch for Hadoop
- Android開發(fā):從0到1 (清華開發(fā)者書庫)
- PHP從入門到精通(第4版)(軟件開發(fā)視頻大講堂)
- C語言開發(fā)基礎(chǔ)教程(Dev-C++)(第2版)
- Julia 1.0 Programming Complete Reference Guide
- 大學(xué)計算機基礎(chǔ)實驗指導(dǎo)
- 程序員的成長課
- 會當(dāng)凌絕頂:Java開發(fā)修行實錄
- 交互設(shè)計師成長手冊:從零開始學(xué)交互
- HTML5游戲開發(fā)實戰(zhàn)
- C Primer Plus(第6版)中文版【最新修訂版】