When.js 2.0.0 发布了,When.js 是 cujojs 的轻量级的 Promises/A 和 when() 实现,从 wire.js 的异步核心和 cujojs 的 IOC 容器派生而来。包含很多其他有用的 Promiss 相关概念,例如联合多个 promiss、mapping 和减少 promises 集合以及 timed promises 等。
该版本主要改进包括:
Fully asynchronous resolutions.
Promises/A+ compliance.
New when/keys module with all() and map() for object keys/values.
New promise.ensure as a better, and safer, replacement for promise.always. See discussion as to why promise.always is mistake-prone.
DEPRECATED: promise.always
lift() is now the preferred name for what was bind() in when/function, when/node/function, and when/callbacks.
DEPRECATED: bind() in when/function, when/node/function, and when/callbacks. Use lift() instead.
项目主页:https://github.com/cujojs/when/blob/master/CHANGES.md
来自:开源中国社区