Created
September 1, 2014 15:08
-
-
Save matsko/ba0ccfa5719432f0f54a 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
function append(prop, promise) { | |
return function(book) { | |
promise.then(function(data) { | |
book[prop] = data; | |
}) | |
} | |
}; | |
var requests = []; | |
var book = bookQuery(isbnQuery(code)) | |
requests[0] = book.then(append('works', worksQuery)) | |
requests[1] = book.then(append('authors', authorsQuery)) | |
return $q.all(requests); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment