Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from xuxihai123/master
Support an initialization parameter
- Loading branch information
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
.idea | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
'use strict' | ||
|
||
module.exports = function promiseWaterfall (callbacks) { | ||
module.exports = function promiseWaterfall (callbacks, initialArgs) { | ||
// Don't assume we're running in an environment with promises | ||
return callbacks.reduce(function (accumulator, callback) { | ||
return accumulator.then(callback) | ||
}, Promise.resolve()) | ||
}, Promise.resolve(initialArgs)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters