title: How to deal with hierarchical data with Reflux stores?
body: <h1>Outline</h1>
  
  <p>In my app I'm using <a href="http://facebook.github.io/react/index.html">React</a> and <a href="https://github.com/spoike/refluxjs">Reflux</a> and have a hierarchical setup with regards to my data. I'm trying to break elements of my app into separate stores to be able to hook events correctly and separate concerns.</p>
  
  <p>I have the following data flow:</p>
  
  <p><code>Workspaces -&gt; Placeholders -&gt; Elements</code></p>
  
  <p>In this scenario, when a workspace is created a default placeholder must in turn be created with a reference (ID) to the newly created workspace. The same applies for the placeholder to element relationship.</p>
  
  <h1>Sticking point</h1>
  
  <p>The Reflux way seems to suggest the PlaceholderStore listens to the triggers from WorkspaceStore, adding the newly created ID to <code>this.trigger()</code>.</p>
  
  <p>Reflux only allows a single event to be triggered from stores; thus preventing external components being able to discern <code>create</code> or <code>update</code> actions. This means that if one trigger in the store sends an ID as <code>argument[0]</code>, subsequent triggers should do the same (to remain consistent). This is a problem for components looking for updates to multiple workspaces (e.g. re-ordering / mass updates).</p>
  
  <h1>Undesirable solution</h1>
  
  <p>I had thought to add in a concept of <code>StoreActions</code>; Actions that only stores can create, that other stores would then listen to (effectively discarding the original trigger from stores). With this components / stores could listen to specific events, and the arguments passed to said events could be tailored without worry. This seems like a wrong way to go and an abuse of the Reflux event system.</p>
  
  <h1>Help</h1>
  
  <p>Should I be trying to break up related data? Is there a better way to structure the data instead?</p>
  
  <p>I've read about aggregate stores, but not seen any implementations to dissect. Do these offer a solution by way of bringing data from multiple stores together, and if so, what is responsible for creating events React components can listen to?</p>
  
  <p>Many thanks for any help / insight anyone can offer!</p>