{"action":"opened","issue":{"url":"https://api.github.com/repos/KarlPurk/redux-decorators/issues/9","repository_url":"https://api.github.com/repos/KarlPurk/redux-decorators","labels_url":"https://api.github.com/repos/KarlPurk/redux-decorators/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/KarlPurk/redux-decorators/issues/9/comments","events_url":"https://api.github.com/repos/KarlPurk/redux-decorators/issues/9/events","html_url":"https://github.com/KarlPurk/redux-decorators/issues/9","id":162651258,"number":9,"title":"Improvements to action reducers.","user":{"login":"KarlPurk","id":1528469,"avatar_url":"https://avatars.githubusercontent.com/u/1528469?v=3","gravatar_id":"","url":"https://api.github.com/users/KarlPurk","html_url":"https://github.com/KarlPurk","followers_url":"https://api.github.com/users/KarlPurk/followers","following_url":"https://api.github.com/users/KarlPurk/following{/other_user}","gists_url":"https://api.github.com/users/KarlPurk/gists{/gist_id}","starred_url":"https://api.github.com/users/KarlPurk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarlPurk/subscriptions","organizations_url":"https://api.github.com/users/KarlPurk/orgs","repos_url":"https://api.github.com/users/KarlPurk/repos","events_url":"https://api.github.com/users/KarlPurk/events{/privacy}","received_events_url":"https://api.github.com/users/KarlPurk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-28T10:18:16Z","updated_at":"2016-06-28T10:18:16Z","closed_at":null,"body":"I think action reducers should be passed the value that they operate on, rather than the full state tree.  So instead of:\r\n\r\n```\r\nclass MyReducers {\r\n    add(state): { return { count: state.count + 1; } \r\n}\r\n```\r\n\r\nInstead we should be able to write something like this:\r\n\r\n```\r\nclass MyReducers {\r\n    add(count = 0): { return count + 1; }\r\n}\r\n```\r\n\r\nThe question is how do we achieve this with decorators?  Do we assume that a class of action reducers all work on the same state slice, like this:\r\n\r\n```\r\n@Reducer({slice: 'count', actions: ['add', 'remove']})\r\nclass MyReducers {\r\n    add(count = 0): { return count + 1; }\r\n}\r\n```\r\n\r\nOr do we implement this on a per-method basis, like this:\r\n\r\n```\r\nclass MyReducers {\r\n    @Reducer('count') add(count = 0): { return count + 1; }\r\n}\r\n```\r\n\r\nThoughts?"}}
{"actor":{"display_login":"KarlPurk"}}