Immutable.js v4.0.0-rc.1 发布,不可变数据集合

发布于 2017年03月12日
收藏 3

Immutable.js v4.0.0-rc.1 发布了,这是一个预览版,因此这里的更新日志不会包含所有的更新内容,查看提交记录以了解完整更新内容。更新内容如下:


  • The Iterable class has been renamed to Collection, and isIterable() has been renamed to isCollection(). Aliases with the existing names exist to make transitioning code easier.

  • The "predicate" functions, isCollectionisKeyedisIndexedisAssociative have been moved from Iterable. to the top level exports.

  • Record is no longer an Immutable Collection type.

    • Now isCollection(myRecord) returns false instead of true.

    • The sequence API (such as mapfilterforEach) no longer exist on Records.

    • delete() and clear() no longer exist on Records.

  • The toJSON() method is now a shallow conversion (previously it was an alias for toJS(), which remains a deep conversion).

  • Some minor implementation details have changed, which may require updates to libraries which deeply integrate with Immutable.js's private APIs.

  • The Cursor API is officially deprecated. Use immutable-cursor instead.


  • A new predicate function isValueObject() helps to detect objects which implement equals() and hashCode(), and type definitions now define the interface ValueObject which you can implement in your own code to create objects which behave as values and can be keys in Maps or entries in Sets.

  • The Flowtype and TypeScript type definitions have been completely rewritten with much higher quality and accuracy, taking advantage of the latest features from both amazing tools.

  • Using fromJS() with a "reviver" function now provides access to the key path to each translated value. (#1118)

Bug 修复

  • Numerous bug fixes have gone into this release


转载请注明:文章转载自 OSCHINA 社区 []
本文标题:Immutable.js v4.0.0-rc.1 发布,不可变数据集合