{"action":"created","issue":{"url":"https://api.github.com/repos/steida/este/issues/294","labels_url":"https://api.github.com/repos/steida/este/issues/294/labels{/name}","comments_url":"https://api.github.com/repos/steida/este/issues/294/comments","events_url":"https://api.github.com/repos/steida/este/issues/294/events","html_url":"https://github.com/steida/este/issues/294","id":89845522,"number":294,"title":"More concise syntax for store action handlers","user":{"login":"steida","id":66249,"avatar_url":"https://avatars.githubusercontent.com/u/66249?v=3","gravatar_id":"","url":"https://api.github.com/users/steida","html_url":"https://github.com/steida","followers_url":"https://api.github.com/users/steida/followers","following_url":"https://api.github.com/users/steida/following{/other_user}","gists_url":"https://api.github.com/users/steida/gists{/gist_id}","starred_url":"https://api.github.com/users/steida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steida/subscriptions","organizations_url":"https://api.github.com/users/steida/orgs","repos_url":"https://api.github.com/users/steida/repos","events_url":"https://api.github.com/users/steida/events{/privacy}","received_events_url":"https://api.github.com/users/steida/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-21T01:33:35Z","updated_at":"2015-06-21T08:53:18Z","closed_at":null,"body":"```es6\r\nimport * as actions from './actions';\r\nimport {authCursor} from '../state';\r\nimport {register} from '../dispatcher';\r\n\r\nexport const dispatchToken = register({\r\n\r\n  [actions.loginError](error) {\r\n    authCursor(auth => auth.setIn(['form', 'error'], error));\r\n  },\r\n\r\n  [actions.updateFormField]({name, value}) {\r\n    authCursor(auth => auth.setIn(['form', 'fields', name], value));\r\n  }\r\n\r\n});\r\n```\r\n\r\nor even\r\n\r\n```es6\r\nimport * as actions from './actions';\r\nimport {authCursor} from '../state';\r\nimport {register} from '../dispatcher';\r\n\r\nexport const dispatchToken = register(authCursor, {\r\n\r\n  [actions.loginError](state, error) {\r\n    return state.setIn(['form', 'error'], error);\r\n  },\r\n\r\n  [actions.updateFormField](state, {name, value}) {\r\n    return state.setIn(['form', 'fields', name], value);\r\n  }\r\n\r\n});\r\n```\r\n\r\n@grabbou WDYT?\r\n\r\nAlso, this will be easy testable once we allow to override mock imports (dispach for actions and register for stores). Let's discuss.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/steida/este/issues/comments/113878773","html_url":"https://github.com/steida/este/issues/294#issuecomment-113878773","issue_url":"https://api.github.com/repos/steida/este/issues/294","id":113878773,"user":{"login":"steida","id":66249,"avatar_url":"https://avatars.githubusercontent.com/u/66249?v=3","gravatar_id":"","url":"https://api.github.com/users/steida","html_url":"https://github.com/steida","followers_url":"https://api.github.com/users/steida/followers","following_url":"https://api.github.com/users/steida/following{/other_user}","gists_url":"https://api.github.com/users/steida/gists{/gist_id}","starred_url":"https://api.github.com/users/steida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steida/subscriptions","organizations_url":"https://api.github.com/users/steida/orgs","repos_url":"https://api.github.com/users/steida/repos","events_url":"https://api.github.com/users/steida/events{/privacy}","received_events_url":"https://api.github.com/users/steida/received_events","type":"User","site_admin":false},"created_at":"2015-06-21T08:53:18Z","updated_at":"2015-06-21T08:53:18Z","body":"I remember, that's why I'm asking you for advice now. Finally I have found time for that :)"}}