immutable
Advanced tools
Comparing version 2.5.0 to 2.5.1
{ | ||
"name": "immutable", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "Immutable Data Collections", | ||
@@ -17,3 +17,3 @@ "homepage": "https://github.com/facebook/immutable-js", | ||
}, | ||
"main": "dist/Immutable.js", | ||
"main": "dist/immutable.js", | ||
"scripts": { | ||
@@ -20,0 +20,0 @@ "test": "jest" |
@@ -247,11 +247,11 @@ Immutable Data Collections | ||
Once the sequence is used, it performs only the work necessary. In this | ||
example, no intermediate arrays are ever created, filter is only called | ||
twice, and map is only called once: | ||
example, no intermediate arrays are ever created, filter is called three times | ||
twice, and map is only called two times: | ||
console.log(oddSquares.last()); // 49 | ||
console.log(oddSquares.get(1)); // 9 | ||
Lazy Sequences allow for the efficient chaining of sequence operations, allowing | ||
for the expression of logic that can otherwise be very tedious: | ||
Lazy Sequences allow for the efficient chaining of sequence operations, | ||
especially when converting to a different concrete type (such as to a JS object): | ||
Immutable.Sequence({a:1, b:1, c:1}) | ||
Immutable.Map({a:1, b:1, c:1}) | ||
.flip().map(key => key.toUpperCase()).flip().toObject(); | ||
@@ -270,2 +270,8 @@ // Map { A: 1, B: 1, C: 1 } | ||
A common pattern is reifying (converting to real form) back to the original | ||
collection type. For example, mapping over a Vector: | ||
var numsVect = Immutable.Vector.from([1,2,3,4,5]); | ||
var squaresVect = numsVect.map(x => x * x).toVector(); | ||
Note: A sequence is always iterated in the same order, however that order may | ||
@@ -272,0 +278,0 @@ not always be well defined, as is the case for the `Map`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234804
385
5426
1