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/keysmodule withall()andmap()for object keys/values. - New
promise.ensureas a better, and safer, replacement forpromise.always. See discussion as to whypromise.alwaysis mistake-prone.- DEPRECATED:
promise.always
- DEPRECATED:
lift()is now the preferred name for what wasbind()in when/function, when/node/function, and when/callbacks.- DEPRECATED:
bind()inwhen/function,when/node/function, andwhen/callbacks. Uselift()instead.
- DEPRECATED:
完整内容请看 Changelog
When.js 的下载地址:请点这里
