- Mastering Immutable.js
- Adam Boduch
- 165字
- 2021-07-08 10:30:03
Persisting changes
If data isn't supposed to change, just how are we supposed to get anything done? How do we move the state of an application along from one state to the next if our data is immutable? The answer is that every operation that you perform on immutable data creates new immutable data. These are called persistent changes, because the original data is persisted. The new data that's created as a result of running the operation contains the changes. When we call an operation on this new data, it returns new data, and so on.
What are we supposed to do with the old data when we make a persistent change that results in new data? The answer is – it depends. Sometimes, you'll just replace the old data with the new data. Yes, the variable is changed, but it's replaced with an entirely new reference. This means that something that is still referencing the old data is never affected by your persistent changes.
- Spring Boot+Spring Cloud+Vue+Element項目實戰(zhàn):手把手教你開發(fā)權限管理系統(tǒng)
- Learning Neo4j 3.x(Second Edition)
- jQuery開發(fā)基礎教程
- 琢石成器:Windows環(huán)境下32位匯編語言程序設計
- C語言程序設計同步訓練與上機指導(第三版)
- Oracle 18c 必須掌握的新特性:管理與實戰(zhàn)
- Node.js Design Patterns
- Learning OpenStack Networking(Neutron)(Second Edition)
- FPGA Verilog開發(fā)實戰(zhàn)指南:基于Intel Cyclone IV(進階篇)
- Python算法詳解
- 基于SpringBoot實現:Java分布式中間件開發(fā)入門與實戰(zhàn)
- Julia High Performance(Second Edition)
- 虛擬現實建模與編程(SketchUp+OSG開發(fā)技術)
- Hadoop Blueprints
- C#程序開發(fā)參考手冊