Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Exports a `Runner` to specify options. * Always return a promise. * Arguments are ignored by default.
- Loading branch information
Showing
22 changed files
with
1,019 additions
and
446 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
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
npm-debug.log | ||
build/ | ||
coverage/ | ||
.nyc_output/ |
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,6 +1,6 @@ | ||
npm-debug.log | ||
changelog.md | ||
coverage | ||
example | ||
test | ||
coverage/ | ||
example/ | ||
test/ | ||
.* |
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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var Runner = require('..').Runner | ||
|
||
var runner = Runner({ input: true }) | ||
|
||
runner.thunkify( | ||
function (a, b) { | ||
// 3 | ||
return a + b | ||
}, | ||
function (sum, next) { | ||
process.nextTick(function () { | ||
// 6 | ||
next(null, sum * 2) | ||
}) | ||
}, | ||
function (product) { | ||
return Promise.resolve().then(function () { | ||
// 7 | ||
return product + 1 | ||
}) | ||
} | ||
)(1, 2) | ||
.then(function (res) { | ||
// [7] | ||
console.log(res) | ||
}) | ||
|
Oops, something went wrong.