{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/812","labels_url":"https://api.github.com/repos/lodash/lodash/issues/812/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/812/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/812/events","html_url":"https://github.com/lodash/lodash/issues/812","id":50705640,"number":812,"title":"wishlist: flatMap","user":{"login":"trashhalo","id":177491,"avatar_url":"https://avatars.githubusercontent.com/u/177491?v=3","gravatar_id":"","url":"https://api.github.com/users/trashhalo","html_url":"https://github.com/trashhalo","followers_url":"https://api.github.com/users/trashhalo/followers","following_url":"https://api.github.com/users/trashhalo/following{/other_user}","gists_url":"https://api.github.com/users/trashhalo/gists{/gist_id}","starred_url":"https://api.github.com/users/trashhalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trashhalo/subscriptions","organizations_url":"https://api.github.com/users/trashhalo/orgs","repos_url":"https://api.github.com/users/trashhalo/repos","events_url":"https://api.github.com/users/trashhalo/events{/privacy}","received_events_url":"https://api.github.com/users/trashhalo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lodash/lodash/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-12-02T19:34:01Z","updated_at":"2015-01-27T17:48:59Z","closed_at":"2014-12-02T20:45:17Z","body":"Something I use a lot in ruby is [flat_map](http://apidock.com/ruby/Enumerable/flat_map) its equivalent to `_.flatten(_.map(` what makes flatMap especially useful is it can be chained down layers of object hierarchy.\r\n\r\nUse case Examples:\r\n* You have a list of boxes that each have a list of items in that box. Your UX wants to show a list of items.\r\n* You have a list of adoption centers, centers have list of adoption records, adoption records list the pet owners. You want to know all pet owners across all centers. flatMap twice, then uniq."},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/71693175","html_url":"https://github.com/lodash/lodash/issues/812#issuecomment-71693175","issue_url":"https://api.github.com/repos/lodash/lodash/issues/812","id":71693175,"user":{"login":"jdalton","id":4303,"avatar_url":"https://avatars.githubusercontent.com/u/4303?v=3","gravatar_id":"","url":"https://api.github.com/users/jdalton","html_url":"https://github.com/jdalton","followers_url":"https://api.github.com/users/jdalton/followers","following_url":"https://api.github.com/users/jdalton/following{/other_user}","gists_url":"https://api.github.com/users/jdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdalton/subscriptions","organizations_url":"https://api.github.com/users/jdalton/orgs","repos_url":"https://api.github.com/users/jdalton/repos","events_url":"https://api.github.com/users/jdalton/events{/privacy}","received_events_url":"https://api.github.com/users/jdalton/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T17:48:59Z","updated_at":"2015-01-27T17:48:59Z","body":"The `_.flatten(_.map(` combo doesn't look that bad.\r\nYou could always do:\r\n```js\r\nvar flatMap = _.compose(_.flatten, _.map)\r\n```"}}