title: What are your best practices for preloading initialState in your Redux apps?
body: <p>I'm currently not happy with the hacks I've come up with using Flux, and now Redux for populating initialState in my store.</p>
  
  <p>I always send a payload of JSON down with the initial page load.  Universal JavaScript is not an option in some of my applications as they are not all backed by Node.  I would like to focus on "best practices" and patterns around how the data is preloaded on the client.  Then, I feel that moving to the server is trivial.</p>
  
  <p>Here’s a gist of what I’m currently doing at work and in a few other toy apps using Redux:</p>
  
  <p><a href="https://gist.github.com/kevinold/5767bb334472b7e2bfe3">https://gist.github.com/kevinold/5767bb334472b7e2bfe3</a></p>
  
  <p>To summarize:  </p>
  
  <ul>
  <li>I’m sending global variables down with the page</li>
  <li>In componentDidMount() I'm dispatching actions that “receive” and handle the various pieces of data.  (These “receive” methods are used when processing these bits of data when they are fetched async via a request action, and I’m repurposing them here since I already have the data.)</li>
  </ul>
  
  <p>This works and there aren’t any issues that we’re running into, but it feels like a hack I’m not really happy with.  Also, I feel that the initial state of Redux isn’t happy with me doing it this way.</p>
  
  <p>According to <a href="http://rackt.org/redux/docs/recipes/ServerRendering.html">http://rackt.org/redux/docs/recipes/ServerRendering.html</a> and the section “The Client Side”, I am able to pass initialState to my store.  </p>
  
  <p>Here’s a patch I have for another project I'm helping with (KeystoneJS). I'm passing it's Keystone object into the initialState:</p>
  
  <p><a href="https://github.com/kevinold/keystone/commit/6f80c2f6f1e5c081361369a8bb31b75f1e62460f#diff-cd8e9933209e834b0519a0257bcfa914R8">https://github.com/kevinold/keystone/commit/6f80c2f6f1e5c081361369a8bb31b75f1e62460f#diff-cd8e9933209e834b0519a0257bcfa914R8</a></p>
  
  <p>While that does work, as you can see, I’m forced to match the shape of the output of my overall combinedReducers (<a href="https://github.com/kevinold/keystone/commit/6f80c2f6f1e5c081361369a8bb31b75f1e62460f#diff-b4b498ca92c4d05e050b45c725c26f9d">https://github.com/kevinold/keystone/commit/6f80c2f6f1e5c081361369a8bb31b75f1e62460f#diff-b4b498ca92c4d05e050b45c725c26f9d</a>) or I will get console warnings, etc.</p>
  
  <p>I might be extremely lazy in dealing with this, but trying to limit having to update another piece of data when I add/change anything related to reducers (add a reducer, how they are composed, etc.).</p>
  
  <p>I realizing I might have to in order to get this initialState into the reducers properly.</p>
  
  <p>I'm currently digesting how (<a href="https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/client.js#L25">https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/client.js#L25</a>) handles it's initialState.</p>
  
  <p>I’d really appreciate some feedback on "best" and "real world" practices that are working for others.</p>