Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
promise sequence exec tasks
function sequenceTasks(tasks) {
function recordValue(results, value) {
return results;
var pushValue = recordValue.bind(null, []);
return tasks.reduce(function (promise, task) {
return promise.then(task).then(pushValue);
}, Promise.resolve());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment