Skip to content

Instantly share code, notes, and snippets.

@myndzi
Last active August 29, 2015 14:10
Show Gist options
  • Save myndzi/8bee58c2753510643aae to your computer and use it in GitHub Desktop.
Save myndzi/8bee58c2753510643aae to your computer and use it in GitHub Desktop.
cinema.locations = function () {
return parse.locationIds()
.map(function (locationId) {
return Promise.props({
postCode: parse.postCode(locationId),
movies: parse.movies(locationId)
});
});
};
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