-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support promises in object #9
base: master
Are you sure you want to change the base?
Conversation
Two concerns:
|
|
If you have ES6 promises, you have Promise.all If you really think this'll be useful, I'm fine with it; please update the READMEs also to mention the new functionality |
@dbushong Yes, but if I want to execute items in series, I have nothing :) Readme updated |
* tasks - An array or object containing functions to run, each function | ||
should return a promise for an optional value. | ||
* tasks - An array, object containing functions to run (each function | ||
should return a promise for an optional value), or an object containing promises that resolve a value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simpler:
"An array or object containing promises or functions to...."
LGTM; one suggested simplification - btw, FFR if you really don't want to use a lib and need to execute things in series you can use reduce: promiseForSeries = [fn1, fn2, fn3].reduce(((p, fn) => p.then(fn)), Promise.resolve()) If you have a fixed number of them, it's even more readable to use |
Don't forget to run |
Allows you to send existing promises directly into the parallel call vs. wrapping in a function