{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/immutable-js/issues/747","repository_url":"https://api.github.com/repos/facebook/immutable-js","labels_url":"https://api.github.com/repos/facebook/immutable-js/issues/747/labels{/name}","comments_url":"https://api.github.com/repos/facebook/immutable-js/issues/747/comments","events_url":"https://api.github.com/repos/facebook/immutable-js/issues/747/events","html_url":"https://github.com/facebook/immutable-js/issues/747","id":125280638,"number":747,"title":"[Question] efficient use of reduce with an immutable reduction?","user":{"login":"mattkrick","id":5514175,"avatar_url":"https://avatars.githubusercontent.com/u/5514175?v=3","gravatar_id":"","url":"https://api.github.com/users/mattkrick","html_url":"https://github.com/mattkrick","followers_url":"https://api.github.com/users/mattkrick/followers","following_url":"https://api.github.com/users/mattkrick/following{/other_user}","gists_url":"https://api.github.com/users/mattkrick/gists{/gist_id}","starred_url":"https://api.github.com/users/mattkrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattkrick/subscriptions","organizations_url":"https://api.github.com/users/mattkrick/orgs","repos_url":"https://api.github.com/users/mattkrick/repos","events_url":"https://api.github.com/users/mattkrick/events{/privacy}","received_events_url":"https://api.github.com/users/mattkrick/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-06T22:46:02Z","updated_at":"2016-04-16T01:34:46Z","closed_at":"2016-04-16T01:34:46Z","body":"What's the best way to reduce to an `Immutable.List`?\r\n\r\n My first attempt is:\r\n```\r\nconst newList = list.reduce((newList, val) => {\r\n      /*do stuff*/\r\n      return newList.push(val);\r\n    }, List())\r\n```\r\nThen i started wondering if I needed something like:\r\n```\r\nconst newList = list.withMutations(mutList => mutList.reduce((newList, val) => {\r\n      /*do stuff*/\r\n      return newList.push(val);\r\n    }, List()))\r\n```\r\nDoes the second approach do anything? Does the first way already have `withMutations` built-in?\r\n\r\n"}}