0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/server/utils/sequence.js

14 lines
287 B
JavaScript
Raw Normal View History

var Promise = require('bluebird');
function sequence(tasks) {
return Promise.reduce(tasks, function (results, task) {
return task().then(function (result) {
results.push(result);
return results;
});
}, []);
}
module.exports = sequence;