alien-node-q-utils
Helper functions for promises with Q on NodeJS. The functions are pure and curried with Ramda.
Install
$ npm install alien-node-q-utils --save
Run the specs
$ npm test
Methods
rejectedPromise
A pre-rejected promise that throws the rejection into an expected catch
block.
;
resolvedPromise
A pre-resolved promise that passes the resolution into the expected then
block.
;
rejectOnErrorOrResolve
Given a function signature of fn(deferred, err, data)
this will reject deferred
if err
is provided,
otherwise resolve deferred
with data
.
- Don't forget this function is curried, so the arity must be recognized. (If you omit the
data
param, you will get a function that accepts only thedata
param.)
var { var deferred = Qdefer; ; return deferredpromise; }; var { var deferred = Qdefer; ; return deferredpromise; }; ; ;
TODO
- Need specs and descriptions for new mapP methods