Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 102 lines (88 sloc) 4.347 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
v0.4.2 -- 2012.01.26
* Optimization. Cut down promise creation time about 60%

v0.4.1 -- 2012.01.26
* Fixed logic error for multi argument `deferred` call. It was same case as with
  `map` fixed with v0.4.0: In specific cases resolve was called in callback
  passed to promise, cause of that any errors that occured in same event loop
  were silent.

v0.4.0 -- 2012.01.19
* Changed the way `end` behaves:
  * When called without arguments, throws error if promise is rejected
  * When called with one function argument, it's treated as callback passed to
    Node.js style asynchronous function. When promise is resolved it is called
    with two arguments, first is error if promise is rejected, second is
    resolved value if promise succeeds.
* When called with two function arguments, first one is taken as onsuccess and
    second as onerror (it behaves similar as `then` but it doesn't extend chain
    with another promise)
* It no longer returns its promise
* Fixed `map` extension. There was logic error: in specific cases resolve of map
  was called in callback passed to promise, cause of that any errors that
  occured in same event loop were silent.
* Removed `cb` extension as now `end` has same functionality

v0.3.1 -- 2012.01.13
* Promisify and invoke extension now resolves also input arguments before
  calling the function
* Possibility to preset fixed number of arguments for promisified function,
  it makes promisified functions less error prone

v0.3.0 -- 2012.01.08
Major update:
* Revised promise collections approach:
  There's no longer all, join & first functions.
  Instead we may use deferred for grouping promises: deferred(p1, p2, p3)
  or use map or reduce extensions e.g. deferred.map(paths, readFile). See
  documentation for more info
* Introduced promise extensions.
  * cb - end promise chain with regular asynchronous callback
  * get - get property of resolved object
  * invoke - invoke function on resolved object (supports both synchronous and
    asynchrouns functions)
  * map - promise aware version of Array's map
  * match - match result array to function arguments
  * reduce promise aware version of Array's reduce
* Replaced asyncToPromise (used as a2p or ba2p) and syncToPromise (used as s2p
  or bs2p) with 'promisify', it works as 'bind' version for both asynchronous
  and synchrounous functions and is available on deferred as deferred.promisify.
  It has also been improved to support asynchronous functions that return more
  than one value.
* Rewritten internal logic. Currently promises are backed with _base object
  which is different for resolved and unresolved promises
* Removed nextTick rule, no new event loops are introduced by deferred.
* Unresolved promises can now be tracked via deferred.MONITOR
* valueOf promise function. Returns self promise if unresolved and resolved
  value if resolved
* isPromise returns true only for deferred's like promise, as deferred api
  diverged from other promises implementations it's no open anymore to work
  with foreign promises.
* Exposed 'isPromise' & 'delay' functions on deferred

v0.2.6 -- 2011.12.12
* Cleared npm warning for misnamed property in package.json

v0.2.5 -- 2011.11.08
* Fix for bug introduced with node.js >= 0.5.7 ( https://github.com/joyent/node/issues/1877 )

v0.2.4 -- 2011.08.09
* Expose 'promise' function on deferred object returned by index.js.
  There are valid use cases for using it outside of deferred lib

v0.2.3 -- 2011.08.09
* 'delay' function: delay execution of given function,
  return promise for function result

v0.2.2 -- 2011.08.08
* Added TAD test suite to devDependencies, configured test commands.
  Tests can be run with 'make test' or 'npm test'

v0.2.1 -- 2011.08.08
* Use process.nextTick instead of setTimeout if available

v0.2.0 -- 2011.08.08
* Renamed 'chain' dir into 'join' as it's more about joining promises
* promise is now promise.then function (promise === promise.then)
* resolve returns promise, handful for quick function returns
  (return d.resolve(x))
* syncToPromise function
* Compatibility with es5-ext v0.6
* Test with TAD

v0.1.2 -- 2011.07.11
* Make it possible to use it with older JavaScript implementations
* Removed dead code
* Better tests coverage

v0.1.1 -- 2011.07.07
* Documentation

v0.1.0 -- 2011.07.05
* Initial version
Something went wrong with that request. Please try again.