Last active
March 16, 2016 06:03
-
-
Save kjessec/9f3fb608fc2a42b3d5fe to your computer and use it in GitHub Desktop.
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
'use strict'; | |
function createAdderJob(val) { | |
return function adder(g) { | |
g.entry = g.entry.map(src => src + val); | |
return g; | |
} | |
} | |
module.exports = createAdderJob; |
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
'use strict'; | |
const createAdder = require('./adder'); | |
const createMuller = require('./muller'); | |
function init(g) { | |
const adder = createAdder(10); | |
const muller = createMuller(2); | |
return Promise.resolve(g) | |
.then(adder) | |
.then(muller); | |
} | |
// start | |
init({ | |
entry: [1, 2, 3, 4, 5] | |
}).then(console.log); |
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
'use strict'; | |
function createMullerJob(val) { | |
return function muller(g) { | |
g.entry = g.entry.map(src => src * val); | |
return g; | |
} | |
} | |
module.exports = createMullerJob; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment