Skip to content

Instantly share code, notes, and snippets.

@kjessec
Last active March 16, 2016 06:03
Show Gist options
  • Save kjessec/9f3fb608fc2a42b3d5fe to your computer and use it in GitHub Desktop.
Save kjessec/9f3fb608fc2a42b3d5fe to your computer and use it in GitHub Desktop.
'use strict';
function createAdderJob(val) {
return function adder(g) {
g.entry = g.entry.map(src => src + val);
return g;
}
}
module.exports = createAdderJob;
'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);
'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