promise helpers (wip)


promise helpers (wip)

$ npm install


function (Promise[]) => Promise

or function (Promise) => Promise

Aggregates an array of promises into one promise which is resolved when every constituent promise is resolved or rejected when some constituent promise is rejected

function (arr, reducerFn, seedValue) => Promise

where the reducerFn has the interface

function (accumulatedValue, currentValue, deferred)

reducerFn can either return a sync value or resolve/reject the deferred argument

like prometido.reduce, but with the reducerFn applied in right-to-left order over the values arr.

function (fn, arg1 ... argN) => Promise

call a function (without this context), ensuring that return value is a Promise and trapping thrown exceptions as a rejected Promise

function (val) => Promise

uses heuristics to ensure that val is a promise. If val is already a promise, it is passed through, otherwise val is returned as a new resolved Promise.

function (err) => Promise

ensures that err is an Error and returns it as a rejected Promise.

$ npm test


MIT (c) 2013 Agile Diagnosis, Inc. See