prometido v0.1.0
prometido
promise helpers (wip)
installation
$ npm installapi
prometido.when
function (Promise[]) => Promiseor 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
prometido.reduce
function (arr, reducerFn, seedValue) => Promisewhere the reducerFn has the interface
function (accumulatedValue, currentValue, deferred)reducerFn can either return a sync value or resolve/reject the deferred argument
prometido.reduceRight
like prometido.reduce, but with the reducerFn applied in right-to-left order over the values arr.
prometido.pCall
function (fn, arg1 ... argN) => Promisecall a function (without this context), ensuring that return value is a Promise and trapping thrown exceptions as a rejected Promise
prometido.asPromise
function (val) => Promiseuses 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.
prometido.asRejectedPromise
function (err) => Promiseensures that err is an Error and returns it as a rejected Promise.
running the tests
$ npm testcontributors
jden jason@denizac.org
license
MIT (c) 2013 Agile Diagnosis, Inc. See LICENSE.md
13 years ago