{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/redux-thunk/issues/29","labels_url":"https://api.github.com/repos/gaearon/redux-thunk/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/redux-thunk/issues/29/comments","events_url":"https://api.github.com/repos/gaearon/redux-thunk/issues/29/events","html_url":"https://github.com/gaearon/redux-thunk/issues/29","id":115180481,"number":29,"title":"Cannot read property 'type' of undefined when no function is explicitly returned on the action creator","user":{"login":"andre0799","id":5369270,"avatar_url":"https://avatars.githubusercontent.com/u/5369270?v=3","gravatar_id":"","url":"https://api.github.com/users/andre0799","html_url":"https://github.com/andre0799","followers_url":"https://api.github.com/users/andre0799/followers","following_url":"https://api.github.com/users/andre0799/following{/other_user}","gists_url":"https://api.github.com/users/andre0799/gists{/gist_id}","starred_url":"https://api.github.com/users/andre0799/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre0799/subscriptions","organizations_url":"https://api.github.com/users/andre0799/orgs","repos_url":"https://api.github.com/users/andre0799/repos","events_url":"https://api.github.com/users/andre0799/events{/privacy}","received_events_url":"https://api.github.com/users/andre0799/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-05T00:17:47Z","updated_at":"2015-11-05T13:52:08Z","closed_at":"2015-11-05T09:32:30Z","body":"Why does I get this error when I implement the action without the return function (and which is how @gaearon told me I should do here https://github.com/rackt/redux/issues/994#issuecomment-153881843  )\r\n\r\n``` \r\nexport function createPlan() {\r\n  return dispatch => {\r\n    const planId = uuid();\r\n    const exerciseId = uuid();\r\n\r\n    dispatch({\r\n      type: 'CREATE_PLAN',\r\n      plan: {title: 'Treino A', exercises: [exerciseId], id: planId},\r\n      id: planId\r\n    });\r\n\r\n    // return function(){\r\n      dispatch({\r\n        type: 'CREATE_EXERCISE',\r\n        id: exerciseId,\r\n        exercise: {\r\n          id: exerciseId,\r\n          title: 'CREATE_PLAN'\r\n        }\r\n      });\r\n    // }\r\n  };\r\n}\r\n\r\n``` \r\n\r\n![image](https://cloud.githubusercontent.com/assets/5369270/10956250/e62b14be-8338-11e5-96a1-b66b106ce2f6.png)\r\n\r\nbut when I uncomment the return function it works?\r\n\r\nI'm calling this action for the view, like this ``` this.props.dispatch(this.actions.createPlan(id))  ``` \r\n\r\nI'm missing something here?"},"comment":{"url":"https://api.github.com/repos/gaearon/redux-thunk/issues/comments/154063309","html_url":"https://github.com/gaearon/redux-thunk/issues/29#issuecomment-154063309","issue_url":"https://api.github.com/repos/gaearon/redux-thunk/issues/29","id":154063309,"user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T13:52:08Z","updated_at":"2015-11-05T13:52:08Z","body":"Can you please create a sample project reproducing the problem?"}}