Last active
August 29, 2015 14:10
-
-
Save myndzi/8bee58c2753510643aae to your computer and use it in GitHub Desktop.
This file contains hidden or 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
cinema.locations = function () { | |
return parse.locationIds() | |
.map(function (locationId) { | |
return Promise.props({ | |
postCode: parse.postCode(locationId), | |
movies: parse.movies(locationId) | |
}); | |
}); | |
}; |
This file contains hidden or 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
cinema.locations = function () { | |
return parse.locationIds() | |
.then(function (locationId) { | |
return Promise.all([ | |
parse.postCode(locationId), | |
parse.movies(locationId) | |
]).spread(function (postCode, movies) { | |
return { | |
address: { | |
postCode: postCode | |
}, | |
movies: movies | |
}; | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment