{"action":"created","issue":{"url":"https://api.github.com/repos/acdlite/flummox/issues/178","labels_url":"https://api.github.com/repos/acdlite/flummox/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/acdlite/flummox/issues/178/comments","events_url":"https://api.github.com/repos/acdlite/flummox/issues/178/events","html_url":"https://github.com/acdlite/flummox/issues/178","id":73831113,"number":178,"title":"Question: Referencing stores from actions","user":{"login":"sconno05","id":2985457,"avatar_url":"https://avatars.githubusercontent.com/u/2985457?v=3","gravatar_id":"","url":"https://api.github.com/users/sconno05","html_url":"https://github.com/sconno05","followers_url":"https://api.github.com/users/sconno05/followers","following_url":"https://api.github.com/users/sconno05/following{/other_user}","gists_url":"https://api.github.com/users/sconno05/gists{/gist_id}","starred_url":"https://api.github.com/users/sconno05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sconno05/subscriptions","organizations_url":"https://api.github.com/users/sconno05/orgs","repos_url":"https://api.github.com/users/sconno05/repos","events_url":"https://api.github.com/users/sconno05/events{/privacy}","received_events_url":"https://api.github.com/users/sconno05/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/acdlite/flummox/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-05-07T04:09:55Z","updated_at":"2015-05-30T19:20:34Z","closed_at":null,"body":"I am currently using flummox in an application (and loving it so first and foremost thanks!) that has two main components:\r\n* A list of items\r\n* Filter selectors for those items\r\n\r\nAt a high level, clicking a filter needs to do the following:\r\n1. Initiate an AJAX call to the server to fetch the new list of items based on current filter selections\r\n2. Add a \"selected\" class to the filter to indicate that it is selected\r\n3. When the AJAX call returns, update the list of items\r\n\r\nSo in flummox terms I have an ItemStore and ItemActions.  ItemActions has a searchItems() function and a few filter functions (e.g. filterName(), filterLocation(), etc.)  The ItemStore state looks something like this:\r\n```javascript\r\n{\r\n  Items: [],\r\n  Filters: {\r\n    SelectedNameFilters: [],\r\n    SelectedLocationFilters: []\r\n  }\r\n}\r\n```\r\nMy reading of flux best practices indicates that the AJAX call should be initiated from action creators (i.e. ItemActions).  It also seems to be recommended that actions not trigger other actions.  In this scenario I have two problems:\r\n\r\n1. Within the filter actions (e.g. filterLocations), I'll need to first update the state of the filters in the store (e.g. SelectedLocationFilters) and then trigger the searchItems() action.  I'm not exactly sure how I can even do this with flummox.\r\n\r\n2. The AJAX call in searchItems() needs to pass data related to the selected filters (e.g. SelectedLocationFilters), so I would need to reference the store.  I'm sure its possible with something like flux.getStore(\"items\"), but it doesn't seem right.\r\n\r\nAny advice you can give on best practice would be most appreciated, thanks!"},"comment":{"url":"https://api.github.com/repos/acdlite/flummox/issues/comments/107077281","html_url":"https://github.com/acdlite/flummox/issues/178#issuecomment-107077281","issue_url":"https://api.github.com/repos/acdlite/flummox/issues/178","id":107077281,"user":{"login":"johanneslumpe","id":3470207,"avatar_url":"https://avatars.githubusercontent.com/u/3470207?v=3","gravatar_id":"","url":"https://api.github.com/users/johanneslumpe","html_url":"https://github.com/johanneslumpe","followers_url":"https://api.github.com/users/johanneslumpe/followers","following_url":"https://api.github.com/users/johanneslumpe/following{/other_user}","gists_url":"https://api.github.com/users/johanneslumpe/gists{/gist_id}","starred_url":"https://api.github.com/users/johanneslumpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanneslumpe/subscriptions","organizations_url":"https://api.github.com/users/johanneslumpe/orgs","repos_url":"https://api.github.com/users/johanneslumpe/repos","events_url":"https://api.github.com/users/johanneslumpe/events{/privacy}","received_events_url":"https://api.github.com/users/johanneslumpe/received_events","type":"User","site_admin":false},"created_at":"2015-05-30T19:20:34Z","updated_at":"2015-05-30T19:20:34Z","body":"@sconno05 is your question solved? :)"}}