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

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.
主站蜘蛛池模板: 大荔县| 奈曼旗| 通河县| 阿拉尔市| 土默特左旗| 广汉市| 泸水县| 韩城市| 共和县| 托克逊县| 南宁市| 精河县| 万源市| 大埔区| 黎平县| 遂溪县| 舟山市| 任丘市| 广元市| 天台县| 土默特右旗| 达尔| 边坝县| 平乐县| 安泽县| 阿鲁科尔沁旗| 大宁县| 得荣县| 澳门| 林甸县| 安徽省| 浪卡子县| 安图县| 江北区| 高碑店市| 新田县| 镇坪县| 肇庆市| 于田县| 鄂托克前旗| 淄博市|