Slide 32
Slide 32 text
All Together
All Together
Foo.prototype.one = Promise.method(function (data) {
this.readAllFilesFor(data)
.bind(this)
.map(this.copyFile)
.then(function(filenames) {
return Promise.all([
this.process(filenames),
this.save(filenames),
this.notify(filenames),
]);
})
.spread(function(fromProcess, fromSave, fromNotify) {
return this.massup(fromProcess, fromSave, fromNotify)
})
.then(this.compress)
.then(this.sign)
.then(this.publish)
.catch(this.onError);
});
<-- filenames is the result of copyfiles()
<-- Parallel Async OPs
<-- spread() is one to one with the array