Last active
August 29, 2015 14:14
-
-
Save sethlivingston/e3d568c401811cf95b92 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
Workflow.run = function (actions) { | |
var files = []; | |
var promise = Promise.resolve(files); | |
actions.forEach(function(action) { | |
promise = promise.then(function (outFiles) { | |
// Need to return a promise here to keep the chain going | |
return new Action(action, outFiles); | |
}); | |
}); | |
promise = promise.catch(function (error) { | |
// Do something here | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment