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

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.
主站蜘蛛池模板: 台东市| 定兴县| 南通市| 揭东县| 九龙坡区| 南部县| 连江县| 于田县| 屯昌县| 绍兴市| 肥乡县| 红安县| 磴口县| 澄迈县| 安宁市| 左云县| 福泉市| 盘锦市| 长治县| 桐柏县| 庆城县| 搜索| 日照市| 册亨县| 桐梓县| 西和县| 门头沟区| 通州市| 金华市| 呼玛县| 来凤县| 泌阳县| 濮阳县| 乌什县| 金昌市| 扬中市| 全椒县| 杨浦区| 泗阳县| 伊吾县| 绵阳市|