{"action":"created","issue":{"url":"https://api.github.com/repos/acdlite/flummox/issues/207","labels_url":"https://api.github.com/repos/acdlite/flummox/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/acdlite/flummox/issues/207/comments","events_url":"https://api.github.com/repos/acdlite/flummox/issues/207/events","html_url":"https://github.com/acdlite/flummox/issues/207","id":82103205,"number":207,"title":"How to implement lazy preload of data","user":{"login":"farnoy","id":345808,"avatar_url":"https://avatars.githubusercontent.com/u/345808?v=3","gravatar_id":"","url":"https://api.github.com/users/farnoy","html_url":"https://github.com/farnoy","followers_url":"https://api.github.com/users/farnoy/followers","following_url":"https://api.github.com/users/farnoy/following{/other_user}","gists_url":"https://api.github.com/users/farnoy/gists{/gist_id}","starred_url":"https://api.github.com/users/farnoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farnoy/subscriptions","organizations_url":"https://api.github.com/users/farnoy/orgs","repos_url":"https://api.github.com/users/farnoy/repos","events_url":"https://api.github.com/users/farnoy/events{/privacy}","received_events_url":"https://api.github.com/users/farnoy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-28T20:05:33Z","updated_at":"2015-05-29T13:20:22Z","closed_at":"2015-05-29T13:20:21Z","body":"Hi,\r\n\r\nI'm making a chat application and migrating to flummox right now. Pretty happy with all of it, but I do have one issue. I'm not sure what's the best way to do a conditional load of data.\r\n\r\nSay you change channels in this chat application, and the app hasn't yet fetched the messages of the channel you're switching to. What's the best way to load this data?\r\n\r\nMy ideas:\r\n- I was thinking about querying the store from the action,  so I can see if it has messages in that channel, or should I preload them. However, I don't like the bidirectional flow of data between Actions and Store in this example, I don't think it's how Flux should work.\r\n- Checking the store from the view and dispatching an action to load missing data conditionally. Again, it's probably even worse than before because we have crucial data logic in the view.\r\n\r\nCan you recommend a good way of solving this? Hope I explained clearly."},"comment":{"url":"https://api.github.com/repos/acdlite/flummox/issues/comments/106800775","html_url":"https://github.com/acdlite/flummox/issues/207#issuecomment-106800775","issue_url":"https://api.github.com/repos/acdlite/flummox/issues/207","id":106800775,"user":{"login":"farnoy","id":345808,"avatar_url":"https://avatars.githubusercontent.com/u/345808?v=3","gravatar_id":"","url":"https://api.github.com/users/farnoy","html_url":"https://github.com/farnoy","followers_url":"https://api.github.com/users/farnoy/followers","following_url":"https://api.github.com/users/farnoy/following{/other_user}","gists_url":"https://api.github.com/users/farnoy/gists{/gist_id}","starred_url":"https://api.github.com/users/farnoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farnoy/subscriptions","organizations_url":"https://api.github.com/users/farnoy/orgs","repos_url":"https://api.github.com/users/farnoy/repos","events_url":"https://api.github.com/users/farnoy/events{/privacy}","received_events_url":"https://api.github.com/users/farnoy/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T13:20:21Z","updated_at":"2015-05-29T13:20:21Z","body":"Thanks for answering! I guess time will tell when my app evolves. I'll try to write back about my experience when my app grows."}}