- 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.
推薦閱讀
- INSTANT Mock Testing with PowerMock
- 移動UI設計(微課版)
- Go語言高效編程:原理、可觀測性與優化
- Java應用開發與實踐
- 深入實踐Spring Boot
- Python神經網絡項目實戰
- Functional Kotlin
- Mastering Apache Maven 3
- Nginx Lua開發實戰
- 深度學習:Java語言實現
- Learning Continuous Integration with TeamCity
- Python項目實戰從入門到精通
- IoT Projects with Bluetooth Low Energy
- Instant Automapper
- Visual C++程序開發范例寶典