- Mastering Immutable.js
- Adam Boduch
- 75字
- 2021-07-08 10:30:11
Updating map values
Let's revisit the earlier example where we called update() on a list. Inside of the update function, increment(), we used set() to change the value of map. Map was the list value that we were updating. Let's make map use the update() method as well:
const increment = map => map.update(
'total',
t => t + map.get('step')
);
Instead of having to call map.get('total'), total is passed in as the function argument.
推薦閱讀
- C及C++程序設計(第4版)
- 大學計算機基礎(第三版)
- 移動UI設計(微課版)
- Leap Motion Development Essentials
- Learning ASP.NET Core 2.0
- 神經網絡編程實戰:Java語言實現(原書第2版)
- 編寫高質量代碼:改善C程序代碼的125個建議
- 單片機應用技術
- 人人都懂設計模式:從生活中領悟設計模式(Python實現)
- Learning jQuery(Fourth Edition)
- QGIS 2 Cookbook
- Web前端開發最佳實踐
- C# 7.0本質論
- ASP.NET Core 2 High Performance(Second Edition)
- Neo4j權威指南 (圖數據庫技術叢書)