## Immutable.js 2.3.0 发布，不可变数据集合

oschina

Immutable.js 2.3.0 发布，此版本现已提供下载，更新内容如下：

### 迭代器!

API:

`values()` returns an iterator object where each call to `next()` provides the next value.

`keys()` returns an iterator object where each call to `next()` provides the next key.

`entries()` returns an iterator object where each call to `next()` provides the next entry as a [key, value] tuple.

```var myMap = Immutable.Map([['A', 1], ['B', 2], ['C', 3]]);
var entries = myMap.entries();
entries.next() // { value: ['A', 1], done: false }
entries.next() // { value: ['B', 2], done: false }
entries.next() // { value: ['C', 3], done: false }
entries.next() // { value: undefined, done: true }```

### 新特性

• `interpose()`

• Sequence documentation is easier to follow now that methods are categorized and alphabetized.

• A number of lazy sequence optimizations. For example, `seq.flip().reverse().flip()` becomes `seq.reverse()`.

• Optimizations that allow `get()` and `has()` to be O(1) on lazy sequences.

### Bugs 修复

• Equality checking via `Immutable.is` or `seq.equals()` could throw or incorrectly return false.

Immutable 是 Facebook 开发的不可变数据集合。不可变数据一旦创建就不能被修改，是的应用开发更简单，允许使用函数式编程技术，比如惰性评估。Immutable JS 提供一个惰性 `Sequence，`允许高效的队列方法链，类似 `map``filter` ，不用创建中间代表。

`immutable` 通过惰性队列和哈希映射提供 `Sequence`, `Range`, `Repeat`, `Map`, `OrderedMap`, `Set` 和一个稀疏 `Vector`