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

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.
主站蜘蛛池模板: 武定县| 延长县| 桐柏县| 汕尾市| 沙洋县| 盘山县| 诸暨市| 迭部县| 大丰市| 紫阳县| 寻甸| 吴旗县| 枣强县| 合作市| 南投市| 缙云县| 绵竹市| 册亨县| 阿坝| 安顺市| 通化市| 嵩明县| 德令哈市| 衡阳县| 林州市| 云阳县| 扎兰屯市| 麟游县| 雅安市| 北流市| 鞍山市| 商洛市| 巨野县| 右玉县| 会昌县| 梓潼县| 漾濞| 临城县| 万盛区| 马鞍山市| 荣成市|