{"action":"created","issue":{"url":"https://api.github.com/repos/quangbuule/redux-example/issues/8","labels_url":"https://api.github.com/repos/quangbuule/redux-example/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/quangbuule/redux-example/issues/8/comments","events_url":"https://api.github.com/repos/quangbuule/redux-example/issues/8/events","html_url":"https://github.com/quangbuule/redux-example/pull/8","id":97801606,"number":8,"title":"Prevent first loading by not dispatching an action when not needed","user":{"login":"nuc-gr","id":697014,"avatar_url":"https://avatars.githubusercontent.com/u/697014?v=3","gravatar_id":"","url":"https://api.github.com/users/nuc-gr","html_url":"https://github.com/nuc-gr","followers_url":"https://api.github.com/users/nuc-gr/followers","following_url":"https://api.github.com/users/nuc-gr/following{/other_user}","gists_url":"https://api.github.com/users/nuc-gr/gists{/gist_id}","starred_url":"https://api.github.com/users/nuc-gr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuc-gr/subscriptions","organizations_url":"https://api.github.com/users/nuc-gr/orgs","repos_url":"https://api.github.com/users/nuc-gr/repos","events_url":"https://api.github.com/users/nuc-gr/events{/privacy}","received_events_url":"https://api.github.com/users/nuc-gr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-28T21:03:10Z","updated_at":"2015-07-29T18:53:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/quangbuule/redux-example/pulls/8","html_url":"https://github.com/quangbuule/redux-example/pull/8","diff_url":"https://github.com/quangbuule/redux-example/pull/8.diff","patch_url":"https://github.com/quangbuule/redux-example/pull/8.patch"},"body":"First of all, thumbs up (:+1:) and thank you (:bow:) for building that repo.\r\n\r\nRegarding avoiding the first loading on page load, that approach is borrowed from [react-redux-universal-hot-example](https://github.com/erikras/react-redux-universal-hot-example).\r\n\r\nAnother approach would be to dispatch an action, something like `UserActionCreators.getOneByUsernameIfNeeded` and perform the check inside there. \r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/quangbuule/redux-example/issues/comments/126057002","html_url":"https://github.com/quangbuule/redux-example/pull/8#issuecomment-126057002","issue_url":"https://api.github.com/repos/quangbuule/redux-example/issues/8","id":126057002,"user":{"login":"nuc-gr","id":697014,"avatar_url":"https://avatars.githubusercontent.com/u/697014?v=3","gravatar_id":"","url":"https://api.github.com/users/nuc-gr","html_url":"https://github.com/nuc-gr","followers_url":"https://api.github.com/users/nuc-gr/followers","following_url":"https://api.github.com/users/nuc-gr/following{/other_user}","gists_url":"https://api.github.com/users/nuc-gr/gists{/gist_id}","starred_url":"https://api.github.com/users/nuc-gr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuc-gr/subscriptions","organizations_url":"https://api.github.com/users/nuc-gr/orgs","repos_url":"https://api.github.com/users/nuc-gr/repos","events_url":"https://api.github.com/users/nuc-gr/events{/privacy}","received_events_url":"https://api.github.com/users/nuc-gr/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T18:53:04Z","updated_at":"2015-07-29T18:53:04Z","body":"Thanks for the feedback. Surely I can point the PR against the RC branch.\r\n\r\nSo a way to do it would be to record the actions triggered on server-side, pass them to the client in order to ignore them when triggered there. There are only two things that come into mind:\r\n\r\n1. How do you suggest to create an action token? What we could do is to record the whole action payload and then do an object comparison (maybe via Immutable.js) on the client, ignore it if it's matching and remove it from the *already-executed-action-pool*. But the problem in that approach would be exactly the case we're trying to solve: async actions returning promises. Obviously we couldn't wait for the final action payload to be compiled since that would be too late (xhr's being fired). So the token approach sounds more feasible but how could we generate a token for that promise, in both server and client?\r\n2. Even though that approach would be more streamlined and avoiding the need of conditions all over the place, it will still contain some magic which the client couldn't override. I started to feel that the conditional action creator sounds more flexible but also explicit about how the system will behave (`UserActionCreators.getOneByUsernameIfNeeded)` that is).\r\n\r\nWaiting for your feedback :)"}}