v2.0.0
#What's new in 2.0
- Resource management - never leak resources again
- Promisification on steroids - entire modules can now be promisified with one line of code
.map()
,.each()
,.filter()
,.reduce()
reimagined from simple sugar to powerful concurrency coordination tools- API Documentation has been reorganized and more elaborate examples added
- Deprecated progression and deferreds
- Improved performance and readability
Features:
- Added
using()
anddisposer()
.map()
now calls the handler as soon as items in the input array become fulfilled- Added a concurrency option to
.map()
.filter()
now calls the handler as soon as items in the input array become fulfilled- Added a concurrency option to
.filter()
.reduce()
now calls the handler as soon as items in the input array become fulfilled, but in-order- Added
.each()
Promise.resolve()
behaves likePromise.cast
.Promise.cast
deprecated.- Synchronous inspection: Removed
.inspect()
, added.value()
and.reason()
Promise.join()
now takes a function as the last argument- Added
Promise.setScheduler()
.cancel()
supports a custom cancellation reason.timeout()
now cancels the promise instead of rejecting it.nodeify()
now supports passing multiple success results when mapping promises to nodebacks- Added
suffix
andfilter
options toPromise.promisifyAll()
Breaking changes:
- Sparse array holes are not skipped by collection methods but treated as existing elements with
undefined
value .map()
and.filter()
do not call the given mapper or filterer function in any specific order- Removed the
.inspect()
method - Yielding an array from a coroutine is not supported by default. You can use
coroutine.addYieldHandler()
to configure the old behavior (or any behavior you want). .any()
and.some()
no longer use an array as the rejection reason.AggregateError
is used instead.