{"action":"created","issue":{"url":"https://api.github.com/repos/wevote/WebApp/issues/105","repository_url":"https://api.github.com/repos/wevote/WebApp","labels_url":"https://api.github.com/repos/wevote/WebApp/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/wevote/WebApp/issues/105/comments","events_url":"https://api.github.com/repos/wevote/WebApp/issues/105/events","html_url":"https://github.com/wevote/WebApp/issues/105","id":136240485,"number":105,"title":"Inconsistency in data retrieving","user":{"login":"lisamcho","id":11385639,"avatar_url":"https://avatars.githubusercontent.com/u/11385639?v=3","gravatar_id":"","url":"https://api.github.com/users/lisamcho","html_url":"https://github.com/lisamcho","followers_url":"https://api.github.com/users/lisamcho/followers","following_url":"https://api.github.com/users/lisamcho/following{/other_user}","gists_url":"https://api.github.com/users/lisamcho/gists{/gist_id}","starred_url":"https://api.github.com/users/lisamcho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisamcho/subscriptions","organizations_url":"https://api.github.com/users/lisamcho/orgs","repos_url":"https://api.github.com/users/lisamcho/repos","events_url":"https://api.github.com/users/lisamcho/events{/privacy}","received_events_url":"https://api.github.com/users/lisamcho/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wevote/WebApp/labels/discussion","name":"discussion","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-02-25T01:03:13Z","updated_at":"2016-02-25T21:13:15Z","closed_at":null,"body":"There's tons of calls to retrieve data from the API but the app is very inconsistent in terms of how information is passed, where API calls to fetch data are made, how the views update themselves.  Can we discuss the advantages/disadvantages and standardize it? Not sure what pattern to follow because there's so many in the app. Also it just makes it harder to work with when it's not consistent.\r\n\r\n1. Sometimes there is an APIWorker, sometimes there isn't. \r\n2. Some (Opinions.jsx) directly make AJAX calls within the component, passing in setState. \r\n3. Others (Ballot.jsx) call a Store initialize or retrieve method, passing in setState. Store's method in turn calls APIWorkers, eventually resolving promise and calling the callback(the setState).\r\n4. Others (PositionItem.jsx) call a Store retrieve method. Store calls APIWorkers, which fire an action when the data is retrieved. AppDispatcher register event, updates the store and emits change, which updates the component because component has registered changeListener.\r\n5. There are other minor variations of these patterns...."},"comment":{"url":"https://api.github.com/repos/wevote/WebApp/issues/comments/188991235","html_url":"https://github.com/wevote/WebApp/issues/105#issuecomment-188991235","issue_url":"https://api.github.com/repos/wevote/WebApp/issues/105","id":188991235,"user":{"login":"lisamcho","id":11385639,"avatar_url":"https://avatars.githubusercontent.com/u/11385639?v=3","gravatar_id":"","url":"https://api.github.com/users/lisamcho","html_url":"https://github.com/lisamcho","followers_url":"https://api.github.com/users/lisamcho/followers","following_url":"https://api.github.com/users/lisamcho/following{/other_user}","gists_url":"https://api.github.com/users/lisamcho/gists{/gist_id}","starred_url":"https://api.github.com/users/lisamcho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisamcho/subscriptions","organizations_url":"https://api.github.com/users/lisamcho/orgs","repos_url":"https://api.github.com/users/lisamcho/repos","events_url":"https://api.github.com/users/lisamcho/events{/privacy}","received_events_url":"https://api.github.com/users/lisamcho/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T21:13:15Z","updated_at":"2016-02-25T21:13:15Z","body":"I'd like to see! @nf071590 "}}