Skip to content
Brian Cavalier edited this page Aug 10, 2012 · 24 revisions

1.4.1

  • Code and unit test cleanup and streamlining--no functional changes.

1.4.0

  • Create a resolved promise: when.resolve(value) creates a resolved promise for value. See API docs.
  • Resolve/reject return something useful: deferred.resolve and deferred.reject now return a promise for the fulfilled or rejected value.
  • Resolve a deferred with another promise: deferred.resolve(promise) - when promise resolves or rejects, so will deferred.

1.3.0

  • Fixed a deviation from the Promises/A spec where returning undefined from a callback or errback would cause the previous value to be forwarded. See #31
    • This could be a breaking change if you depended on this behavior. If you encounter problems, the solution is to ensure that your promise callbacks (registered either with when() or .then()) return what you intend, keeping in mind that not returning something is equivalent to returning undefined.
  • This change also restores compatibility with the promises returned by jQuery.get(), which seem to reject with themselves as the rejection value. See issue #41 for more information and discussion. Thanks to @KidkArolis for raising the issue.

1.2.0

  • promise.otherwise(errback) as a shortcut for promise.then(null, errback). See discussion here and here. Thanks to @jonnyreeves for suggesting the name "otherwise".
  • when/debug now detects exceptions that typically represent coding errors, such as SyntaxError, ReferenceError, etc. and propagates them to the host environment. In other words, you'll get a very loud stack trace.

1.1.1

  • Updated wiki map/reduce examples, and added simple promise forwarding example
  • Fix for calling when.any() without a callback (#33)
  • Fix version number in when.js source (#36)

1.1.0

  • when.all/any/some/map/reduce can all now accept a promise for an array in addition to an actual array as input. This allows composing functions to do interesting things like when.reduce(when.map(...))
  • when.reject(promiseOrValue) that returns a new, rejected promise.
  • promise.always(callback) as a shortcut for promise.then(callback, callback)
  • Highly experimental when/debug module: a drop-in replacement for the main when module that enables debug logging for promises created or consumed by when.js

1.0.4

  • Travis CI integration
  • Fix for cancelable deferred not invoking progress callbacks. (#24 Thanks @scothis)
  • The promise returned by when.chain now rejects when the input promise rejects.

1.0.3

  • Fix for specific situation where null could incorrectly be used as a promise resolution value (#23)

1.0.2

  • Updated README for running unit tests in both Node and Browsers. See Running the Unit Tests below.
  • Set package name to 'when' in package.json

1.0.1

  • Fix for rejections propagating in some cases when they shouldn't have been (#19)
  • Using buster.js for unit tests now.

1.0.0

  • First official when.js release as a part of cujojs.
  • Added when/cancelable decorator for creating cancelable deferreds
  • Added when/delay and when/timeout helpers for creating delayed promises and promises that timeout and reject if not resolved first.

0.11.1

  • Added when/apply helper module for using arguments-based and variadic callbacks with when.all, when.some, when.map, or any promise that resolves to an array. (#14)
  • .then(), when(), and all other methods that accept callback/errback/progress handlers will throw if you pass something that's not a function. (#15)

0.11.0

  • when.js now assimilates thenables that pass the Promises/A duck-type test, but which may not be fully Promises/A compliant, such as jQuery's Deferred and curl's global API (See the API at a glance section)
    • when(), and when.all/some/any/map/reduce/chain() are all now guaranteed to return a fully Promises/A compliant promise, even when their input is not compliant.
    • Any non-compliant thenable returned by a callback or errback will also be assimilated to protect subsequent promises and callbacks in a promise chain, and preserve Promises/A forwarding guarantees.

0.10.4

  • Important Fix for some AMD build/optimizer tools: Switching back to more verbose, builder-friendly boilerplate
    • If you are using when.js 0.10.3 with the dojo or RequireJS build tools, you should update to v.10.4 as soon as possible.

0.10.3

Warning: This version will not work with most AMD build tools. You should update to 0.10.4 as soon as possible.

  • Minor package.json updates
  • Slightly smaller module boilerplate

0.10.2

  • Performance optimizations for when.map() (thanks @smitranic), especially for large arrays where the mapFunc is also async (i.e. returns a promise)
  • when.all/some/any/map/reduce handle sparse arrays (thanks @rwaldrn)
  • Other minor performance optimizations

0.10.1

  • Minor tweaks (thanks @johan)
    • Add missing semis that WebStorm didn't catch
    • Fix DOH submodule ref, and update README with info for running unit tests

0.10.0

  • when.map and when.reduce - just like Array.map and Array.reduce, but they operate on promises and arrays of promises
  • Lots of internal size and performance optimizations
  • Still only 1k!

0.9.4

  • Important fix for break in promise chains
Clone this wiki locally