{"action":"created","issue":{"url":"https://api.github.com/repos/bdefore/universal-redux/issues/42","labels_url":"https://api.github.com/repos/bdefore/universal-redux/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/bdefore/universal-redux/issues/42/comments","events_url":"https://api.github.com/repos/bdefore/universal-redux/issues/42/events","html_url":"https://github.com/bdefore/universal-redux/issues/42","id":125794829,"number":42,"title":"Error adding middleware","user":{"login":"shilpan","id":2342067,"avatar_url":"https://avatars.githubusercontent.com/u/2342067?v=3","gravatar_id":"","url":"https://api.github.com/users/shilpan","html_url":"https://github.com/shilpan","followers_url":"https://api.github.com/users/shilpan/followers","following_url":"https://api.github.com/users/shilpan/following{/other_user}","gists_url":"https://api.github.com/users/shilpan/gists{/gist_id}","starred_url":"https://api.github.com/users/shilpan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shilpan/subscriptions","organizations_url":"https://api.github.com/users/shilpan/orgs","repos_url":"https://api.github.com/users/shilpan/repos","events_url":"https://api.github.com/users/shilpan/events{/privacy}","received_events_url":"https://api.github.com/users/shilpan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-10T02:53:46Z","updated_at":"2016-01-10T03:44:44Z","closed_at":null,"body":"I am trying to add a middleware like so in `middleware/index`:\r\n\r\n```javascript\r\nfunction thunkMiddleware({ dispatch, getState }) {\r\n  return next => action =>\r\n    typeof action === 'function' ?\r\n      action(dispatch, getState) :\r\n      next(action);\r\n}\r\n\r\nexport default {\r\n  thunk: thunkMiddleware\r\n};\r\n```\r\n\r\nAnd my action is as such:\r\n\r\n```javascript\r\nexport const ingredientsQuery = ({field}) => {\r\n  return dispatch => {\r\n    dispatch(requestFetch(field));\r\n\r\n    return new Promise((resolve) => {\r\n      setTimeout(() => {\r\n        resolve([\r\n          'Water',\r\n          'Milk',\r\n          'Curd'\r\n        ]);\r\n      }, 100); // simulate server latency\r\n    }).then(data =>\r\n      (dispatch(requestRecieve(data, field))));\r\n  };\r\n};\r\n```\r\n\r\nI keep getting the error:\r\n\r\n```\r\nWarning: Failed propType: Invalid prop `action` of type `function` supplied to `LogMonitorEntry`, expected `object`. Check the render method of `LogMonitor`.\r\n```\r\n\r\nAnd none of my actions inside the thunk function are being dispatched. It seems like `thunk` the middleware is not getting attached. Or is there something I am doing wrong?"},"comment":{"url":"https://api.github.com/repos/bdefore/universal-redux/issues/comments/170308059","html_url":"https://github.com/bdefore/universal-redux/issues/42#issuecomment-170308059","issue_url":"https://api.github.com/repos/bdefore/universal-redux/issues/42","id":170308059,"user":{"login":"shilpan","id":2342067,"avatar_url":"https://avatars.githubusercontent.com/u/2342067?v=3","gravatar_id":"","url":"https://api.github.com/users/shilpan","html_url":"https://github.com/shilpan","followers_url":"https://api.github.com/users/shilpan/followers","following_url":"https://api.github.com/users/shilpan/following{/other_user}","gists_url":"https://api.github.com/users/shilpan/gists{/gist_id}","starred_url":"https://api.github.com/users/shilpan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shilpan/subscriptions","organizations_url":"https://api.github.com/users/shilpan/orgs","repos_url":"https://api.github.com/users/shilpan/repos","events_url":"https://api.github.com/users/shilpan/events{/privacy}","received_events_url":"https://api.github.com/users/shilpan/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T03:44:44Z","updated_at":"2016-01-10T03:44:44Z","body":"@bdefore 2.x"}}