- 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.
推薦閱讀
- HornetQ Messaging Developer’s Guide
- MySQL數(shù)據(jù)庫管理實戰(zhàn)
- 數(shù)據(jù)庫系統(tǒng)教程(第2版)
- 小創(chuàng)客玩轉(zhuǎn)圖形化編程
- 可解釋機(jī)器學(xué)習(xí):模型、方法與實踐
- BeagleBone Black Cookbook
- 西門子S7-200 SMART PLC編程從入門到實踐
- Python圖形化編程(微課版)
- Hands-On Nuxt.js Web Development
- JSP程序設(shè)計實例教程(第2版)
- C++ Application Development with Code:Blocks
- 你好!Java
- SAS編程演義
- Python Django Web從入門到項目實戰(zhàn)(視頻版)
- C語言從入門到精通(微視頻精編版)