Last active
December 19, 2015 11:39
-
-
Save briancavalier/5948810 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
var when = require('when'); | |
var parallel = require('when/parallel'); | |
parallel([getData, makeFolder]) | |
.spread(writeFile) | |
.then(emailLink) | |
.then(console.log); | |
function getData() { | |
return when('the data'); | |
} | |
function makeFolder() { | |
return when('the folder'); | |
} | |
function writeFile(data, folder) { | |
return when(folder + '/' + data); | |
} | |
function emailLink(file) { | |
return when('http://link.to/the/file'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment