{"action":"created","issue":{"url":"https://api.github.com/repos/ashaffer/virtex-local/issues/4","labels_url":"https://api.github.com/repos/ashaffer/virtex-local/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/ashaffer/virtex-local/issues/4/comments","events_url":"https://api.github.com/repos/ashaffer/virtex-local/issues/4/events","html_url":"https://github.com/ashaffer/virtex-local/issues/4","id":124592133,"number":4,"title":"local actions (via events) don't go through middleware","user":{"login":"queckezz","id":2580598,"avatar_url":"https://avatars.githubusercontent.com/u/2580598?v=3","gravatar_id":"","url":"https://api.github.com/users/queckezz","html_url":"https://github.com/queckezz","followers_url":"https://api.github.com/users/queckezz/followers","following_url":"https://api.github.com/users/queckezz/following{/other_user}","gists_url":"https://api.github.com/users/queckezz/gists{/gist_id}","starred_url":"https://api.github.com/users/queckezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queckezz/subscriptions","organizations_url":"https://api.github.com/users/queckezz/orgs","repos_url":"https://api.github.com/users/queckezz/repos","events_url":"https://api.github.com/users/queckezz/events{/privacy}","received_events_url":"https://api.github.com/users/queckezz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-01-02T13:48:28Z","updated_at":"2016-01-10T11:43:17Z","closed_at":"2016-01-10T02:35:37Z","body":"https://github.com/ashaffer/virtex-local/blob/master/src/index.js#L75\r\n\r\n```js\r\nthunk.type.reducer(thunk.state, fn.apply(thunk, outerArgs.concat(innerArgs))\r\n```\r\n\r\nThis is just basic reducer but no dispatching of the local action through the middleware system. So stuff  like `redux-multi` or `redux-logger` won't work. I find `redux-logger` almost essential to the whole architecture:\r\n\r\n```js\r\nreturn (\r\n  <button onClick={local(e => {\r\n    return [\r\n      action1(),\r\n      action2()\r\n    ]\r\n  })}>\r\n    Button\r\n  </button>\r\n)\r\n```\r\n\r\nI think `dispatch(fn.apply(thunk, outerArgs.concat(innerArgs)))` should work? \r\n\r\n**Edit:** This would mean we would enforce that all local actions need to be scoped globally, so\r\n```js\r\nconst localAction = createAction('@myComponent/action')\r\n```\r\n\r\nOr we could also additionally add  `{ __local: true }` to `action.meta` so we can have some kind of information when debugging that this is indeed a local action and remove those from the global reducing function.\r\n```js\r\n// virtex-local\r\nconst action = fn.apply(thunk, [...outerArgs, ...innerArgs])\r\naction.meta = { ...action.meta, __local: true }\r\n\r\n// vdux-preset-client\r\nimport { ignoreActions } from 'redux-ignore';\r\nignoreActions(reducer, (action) => action.meta.__local)\r\n\r\n```\r\n\r\n**Sidenote:**\r\nFor me as a contributor it's almost impossible to test because I have to fork vdux and connect it to my forked `virtex-local` branch to finally test it. If something goes wrong I need to update `virtex-local` again, push it and then test again. They are spread across even though they depend on each other so closely. Making changes this way is hard. Most of the time you work on `virtex`, `virtex-local` etc. together, right? Definitely would prefer tests locally to the repository. And if that's not possible maybe it's better to merge it into one library like deku, [recompose](https://github.com/acdlite/recompose/tree/master/src) or babeljs does?"},"comment":{"url":"https://api.github.com/repos/ashaffer/virtex-local/issues/comments/170337641","html_url":"https://github.com/ashaffer/virtex-local/issues/4#issuecomment-170337641","issue_url":"https://api.github.com/repos/ashaffer/virtex-local/issues/4","id":170337641,"user":{"login":"queckezz","id":2580598,"avatar_url":"https://avatars.githubusercontent.com/u/2580598?v=3","gravatar_id":"","url":"https://api.github.com/users/queckezz","html_url":"https://github.com/queckezz","followers_url":"https://api.github.com/users/queckezz/followers","following_url":"https://api.github.com/users/queckezz/following{/other_user}","gists_url":"https://api.github.com/users/queckezz/gists{/gist_id}","starred_url":"https://api.github.com/users/queckezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queckezz/subscriptions","organizations_url":"https://api.github.com/users/queckezz/orgs","repos_url":"https://api.github.com/users/queckezz/repos","events_url":"https://api.github.com/users/queckezz/events{/privacy}","received_events_url":"https://api.github.com/users/queckezz/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T11:43:17Z","updated_at":"2016-01-10T11:43:17Z","body":"Could be or my internet is just slow. I don't have any alternatives atm. Anyway I've found some wierd issues on the `routing` example. \r\n\r\nIn `components/layouts/main.js` children is actually undefined but it seems everything is hooked up correctly.\r\n```js\r\nconst {nav, children} = props // children -> undefined\r\n```\r\n\r\nThe entire `<MainLayout>` also gets removed and inserted on every click. Is this intended? I don't really have too much experience about that stuff.\r\n\r\n![animation](https://cloud.githubusercontent.com/assets/2580598/12221342/60145e88-b797-11e5-9b4e-06859eb24e4f.gif)\r\n"}}