{"action":"closed","issue":{"url":"https://api.github.com/repos/thoughtbot/Delta/issues/5","repository_url":"https://api.github.com/repos/thoughtbot/Delta","labels_url":"https://api.github.com/repos/thoughtbot/Delta/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/Delta/issues/5/comments","events_url":"https://api.github.com/repos/thoughtbot/Delta/issues/5/events","html_url":"https://github.com/thoughtbot/Delta/issues/5","id":118128193,"number":5,"title":"Give Action.reduce a subset of the state","user":{"login":"jakecraige","id":3799709,"avatar_url":"https://avatars0.githubusercontent.com/u/3799709?v=4","gravatar_id":"","url":"https://api.github.com/users/jakecraige","html_url":"https://github.com/jakecraige","followers_url":"https://api.github.com/users/jakecraige/followers","following_url":"https://api.github.com/users/jakecraige/following{/other_user}","gists_url":"https://api.github.com/users/jakecraige/gists{/gist_id}","starred_url":"https://api.github.com/users/jakecraige/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakecraige/subscriptions","organizations_url":"https://api.github.com/users/jakecraige/orgs","repos_url":"https://api.github.com/users/jakecraige/repos","events_url":"https://api.github.com/users/jakecraige/events{/privacy}","received_events_url":"https://api.github.com/users/jakecraige/received_events","type":"User","site_admin":false},"labels":[{"id":286371501,"url":"https://api.github.com/repos/thoughtbot/Delta/labels/feature%20request","name":"feature request","color":"84b6eb","default":false},{"id":292470841,"url":"https://api.github.com/repos/thoughtbot/Delta/labels/nice%20to%20have","name":"nice to have","color":"bfe5bf","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2015-11-20T21:21:33Z","updated_at":"2017-09-29T18:10:36Z","closed_at":"2017-09-29T18:10:36Z","author_association":"MEMBER","body":"Currently all `Action`s `reduce` method take the entire state as an object and return a new one. It would be nice if there were some way to configure it to receive and return a subset of that.\n\nCurrently you have to do it like so:\n\n``` swift\nstruct SetUsersAction: Action {\n    let users: [User]\n\n    func reduce(state: AppState) -> AppState {\n        state.users.value = users\n        return state\n    }\n}\n```\n\nI think the ideal would be like:\n\n``` swift\nstruct SetUsersAction: Action {\n    let users: [User]\n\n    func reduce(state: [User]) -> [User] {\n        return users;\n    }\n}\n```\n\nI have no idea how we could pull something like this off.\n"}}
{"actor":{"display_login":"jakecraige"}}