Changelog
0.8.6
npost
and ninvoke
to pass the correct thisp
. #74Q.all
for arrays contain already-resolved promises or scalar
values. @ForbesLindesay.npmignore
file so that dependent packages get a slimmer
node_modules
directory.Changelog
0.8.5
fapply
, fcall
, fbind
for non-thisp
promised function calls.return
for async generators, where generators
are implemented.Changelog
0.8.4
promise.timeout
is now rejected with an Error
object
and the message now includes the duration of the timeout in
miliseconds. This doesn't constitute (in my opinion) a
backward-incompatibility since it is a change of an undocumented and
unspecified public behavior, but if you happened to depend on the
exception being a string, you will need to revise your code.deferred.makeNodeResolver()
to replace the more cryptic
deferred.node()
method.Q.promise(maker(resolve, reject))
to make a
promise inside a callback, such that thrown exceptions in the
callback are converted and the resolver and rejecter are arguments.
This is a shorthand for making a deferred directly and inspired by
@gozala’s stream constructor pattern and the Microsoft Windows Metro
Promise constructor interface.Q.begin()
that is intended to kick off chains
of .then
so that each of these can be reordered without having to
edit the new and former first step.Changelog
0.8.3
isFulfilled
, isRejected
, and isResolved
to the promise prototype.allResolved
for waiting for every promise to either be
fulfilled or rejected, without propagating an error. @utvara #53Q.bind
as a method to transform functions that
return and throw into promise-returning functions. See
an example. @domenicnode
export to nbind
, and added napply
to
complete the set. node
remains as deprecated. @domenic #58Method
export to sender
. Method
remains as deprecated and will be removed in the next
major version since I expect it has very little usage.msSetImmediate
(IE10) or setImmediate
(available via polyfill)
as a browser-side nextTick
implementation. #44 #50 #59process.nextTick
.finally
alias for fin
, catch
alias for fail
, try
alias for call
, and delete
alias
for del
. These properties are enquoted in the library for
cross-browser compatibility, but may be used as property names in
modern engines.Changelog
0.8.2
ref
in favor of resolve
as recommended by
@domenic.Changelog
0.8.0
enqueue
removed. Use nextTick
instead.
This is more consistent with NodeJS and (subjectively)
more explicit and intuitive.def
removed. Use master
instead. The
term def
was too confusing to new users.spy
removed in favor of fin
.wait
removed. Do all(args).get(0)
instead.join
removed. Do all(args).spread(callback)
instead.Q
function module.exports alias
for Q.ref
. It conflicts with Q.apply
in weird
ways, making it uncallable.delay
so that it accepts both (value, timeout)
and (timeout)
variations based on
arguments length.ref().spread(cb(...args))
, a variant of
then
that spreads an array across multiple arguments.
Useful with all()
.defer().node()
Node callback generator. The
callback accepts (error, value)
or (error, ...values)
. For multiple value arguments, the
fulfillment value is an array, useful in conjunction with
spread
.node
and ncall
, both with the signature
(fun, thisp_opt, ...args)
. The former is a decorator
and the latter calls immediately. node
optional
binds and partially applies. ncall
can bind and pass
arguments.Changelog
0.7.1
Array.prototype.reduce
. The
enumerable property has bad side-effects. Libraries that
depend on this (for example, QQ) will need to be revised.Changelog
0.7.0 - BACKWARD INCOMPATIBILITY
report
and asap
callback
argument of the fin
function no longer receives any arguments. Thus, it can
be used to call functions that should not receive
arguments on resolution. Use when
, then
, or
fail
if you need a value.MessageChannel
for nextTick
.enqueue
to nextTick
.view
and viewInfo
for creating
views of promises either when or before they're
fulfilled.