作者:abc | 来源:互联网 | 2014-10-12 00:05
第29期OSC源创会#南京#开始报名,AngularJS、Netty 等
Immutable.js 2.2.2 发布,此版本现已提供下载,更新内容如下:
Improved using arbitrary Objects as keys or as members of a Set for IE8.
Fixed: collections did not always return correct length iterated from forEach()
Sequences (and Maps, Vectors, and Sets) can now be constructed from
Iterables and Iterators. This enables Map and Set construction similar
to ES6 spec.
var m = new Map([['A', 1], ['B', 2], ['C', 3]]);
// Map {"A" => 1, "B" => 2, "C" => 3}
var im = Immutable.Map(m);
// Map { A: 1, B: 2, C: 3 }
m = new Map(im);
// Map {"A" => 1, "B" => 2, "C" => 3}
Fixed: some Sequences did not properly provide themselves as the 3rd argument in iteration.
Fixed: take()
could iterate one step too far.
Fixed: getIn()
could throw if one of the intermediate keys does not exist.
Immutable 是 Facebook 开发的不可变数据集合。不可变数据一旦创建就不能被修改,是的应用开发更简单,允许使用函数式编程技术,比如惰性评估。Immutable JS 提供一个惰性 Sequence,
允许高效的队列方法链,类似 map
和 filter
,不用创建中间代表。
immutable
通过惰性队列和哈希映射提供 Sequence
, Range
, Repeat
, Map
, OrderedMap
, Set
和一个稀疏 Vector
。