- 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.
推薦閱讀
- Mastering JavaScript Object-Oriented Programming
- 深度學習經典案例解析:基于MATLAB
- Linux C/C++服務器開發實踐
- Learning Bayesian Models with R
- Spring Cloud、Nginx高并發核心編程
- MariaDB High Performance
- 微信小程序入門指南
- Mastering Android Game Development
- Illustrator CC平面設計實戰從入門到精通(視頻自學全彩版)
- Learning Grunt
- Greenplum構建實時數據倉庫實踐
- Python Social Media Analytics
- Java RESTful Web Service實戰
- Sitecore Cookbook for Developers
- Elastix Unified Communications Server Cookbook