q-promise-utils
Several utils for simpifying interaction with multiple async operations.
API
utils.sequence(funcs, [args])
Executes funcs
in async manner one by one.
Arguments:
- funcs - functions to execute
- args (optional) - arguments to pass to each function
Example:
var {} {}; utils ;
utils.seqMap(items, callback)
Serially applies callback
to each item in items
array in async manner
Example:
var items = 'foo' 'bar' {}; utils ;
utils.waitForResults(promises)
Waits for all promises in array to be resolved or rejected. Unlike Q.allSettled, rejects when any of the promises is rejected. Unlike Q.all does not immediately rejects a promise on a first error and waits for other operations to complete.
Example:
var delay = q rejected = q; utils ;