- Mastering Immutable.js
- Adam Boduch
- 176字
- 2021-07-08 10:30:04
Chaining method calls
Immutable data doesn't just sit inside of a constant. Somehow, your applications need to make use of this data. These are called side-effects. A side-effect is something that is effected by immutable data, such as rendering data on the screen in a user interface or writing data to a file. By contrast, operations performed on immutable collections are either persistent changes or sequence transformations, both of which result in new collections. These operations don't have any side-effects; they just result in new data being created. Another term used for functions that don't cause side-effects is pure functions.
With Immutable.js, you start with a collection of immutable data and work your way toward some sort of side-effect. In functional programming, it's generally best to avoid side-effects due to the problems they cause. But side-effects are unavoidable. Without them, your software cannot interact with its environment. By chaining together Immutable.js collection methods, you can write clean and concise code that transforms immutable data into something that you need—something that a side-effect can use.
- 手機安全和可信應(yīng)用開發(fā)指南:TrustZone與OP-TEE技術(shù)詳解
- WildFly:New Features
- Mastering Unity Shaders and Effects
- Java程序設(shè)計
- 小學(xué)生C++創(chuàng)意編程(視頻教學(xué)版)
- 單片機應(yīng)用與調(diào)試項目教程(C語言版)
- Learning ArcGIS for Desktop
- UVM實戰(zhàn)
- 圖數(shù)據(jù)庫實戰(zhàn)
- R Data Science Essentials
- 編程改變生活:用Python提升你的能力(進階篇·微課視頻版)
- CodeIgniter Web Application Blueprints
- Getting Started with React VR
- WordPress Search Engine Optimization(Second Edition)
- Laravel Design Patterns and Best Practices