Comparison of two different approaches to structuring code that uses Promises.
Version using .then()
, from Complex task dependencies:
files.getLastTwoVersions(filename)
.then(function(items) {
return [versions.get(items.last),
versions.get(items.previous)];
})