官术网_书友最值得收藏!

Chaining value insertion methods

When you need to insert more than one value into a collection, you have to call push() or set() multiple times. Instead of storing the new collection every time that you call the method, you can chain the method calls together. You can store the result of this chained call, which is the last collection. The other collections are called intermediary collections, which are freed the next time the garbage collector runs.

Immutable.js can copy collections efficiently because it only copies the parts of the collection that it absolutely needs to copy. When you make persistent changes, most of the old collection data is shared with the new collection. It can do this because most of the collection data hasn't changed, so it would be wasteful just to throw it to the garbage collector.
主站蜘蛛池模板: 阳城县| 土默特左旗| 房产| 青田县| 四平市| 昭觉县| 环江| 新邵县| 苗栗市| 获嘉县| 洪洞县| 新泰市| 吴堡县| 绥中县| 东莞市| 澜沧| 马山县| 太原市| 巴彦淖尔市| 清原| 丹阳市| 辽阳市| 林口县| 万安县| 平利县| 奎屯市| 临西县| 丹凤县| 方城县| 方正县| 布尔津县| 乌拉特前旗| 南丰县| 汾西县| 成都市| 胶州市| 永平县| 弋阳县| 云龙县| 甘孜| 丽江市|