- 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.
- scikit-learn Cookbook
- Mobile Application Development:JavaScript Frameworks
- 騰訊iOS測試實踐
- VMware vSphere 6.7虛擬化架構實戰指南
- Quarkus實踐指南:構建新一代的Kubernetes原生Java微服務
- Spring實戰(第5版)
- AutoCAD VBA參數化繪圖程序開發與實戰編碼
- 小學生C++創意編程(視頻教學版)
- The Complete Coding Interview Guide in Java
- 編程數學
- 微服務架構深度解析:原理、實踐與進階
- AIRIOT物聯網平臺開發框架應用與實戰
- Android項目實戰:手機安全衛士開發案例解析
- Android應用開發深入學習實錄
- QPanda量子計算編程