Created
July 7, 2014 02:40
-
-
Save cwharris/d7085d2a204f7a23bf4d 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
movieFinder.find('Falcon') | |
.flatMap(function (movie) { | |
return geocoder | |
.geocode(movie.locations) | |
.take(1) | |
.pluck('geometry.location') | |
.map(function (location) { | |
return { | |
location: location, | |
movie: movie | |
}; | |
}); | |
}) | |
.subscribe(log); |
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
movieFinder.find('Falcon') | |
.flatMap(movieToResult) | |
.subscribe(log); | |
function movieToResult (movie) { | |
return geocoder | |
.geocode(movie.location) | |
.take(1) | |
.pluck('geometry.location') | |
.map(movieAndLocationToResult.bind(undefined, movie)); | |
} | |
function movieAndLocationToResult (movie, location) { | |
return { | |
movie: movie, | |
location: location | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment