- 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.
- Practical Data Analysis Cookbook
- C++案例趣學
- Network Automation Cookbook
- PLC編程與調試技術(松下系列)
- Rust游戲開發實戰
- Java并發編程:核心方法與框架
- Scala Functional Programming Patterns
- Maven for Eclipse
- Oracle Database XE 11gR2 Jump Start Guide
- 計算機應用基礎(Windows 7+Office 2010)
- Learning TypeScript
- Apache Kafka 1.0 Cookbook
- Learning ROS for Robotics Programming
- MonoTouch應用開發實踐指南:使用C#和.NET開發iOS應用
- Microsoft Azure Security