title: How to save Redux Store as a downloaded file and then load it back?
body: <p>I have a web app which has a notion of projects. I am using <code>react</code>, <code>react-redux</code> and <code>react-persist</code> with <code>localForage</code> as the persist target. </p>
  
  <p>I am now trying to implement <strong>project save</strong> and <strong>project load</strong> functionality, and the entire Redux State serves as a project file. The project file should be saved to disk as a user download. And/or any cloud file storage service.</p>
  
  <p>The saving part is trivial, just take the store, serialize to JSON and plop it to the user for download.</p>
  
  <p>The loading is a little bit trickier, my <code>ReactDOM.render</code> is fairly usual.</p>
  
  <pre class="lang-js prettyprint-override"><code>const {store, persistor} = configureStore()
  ReactDOM.render(
    &lt;Provider store={store}&gt;
      &lt;PersistGate loading={null} persistor={persistor}&gt;
        &lt;Router&gt;
          &lt;Route path={`${process.env.PATH}/`} component={App} /&gt;
        &lt;/Router&gt;
      &lt;/PersistGate&gt;
    &lt;/Provider&gt;,
    document.getElementById('app')
  )
  </code></pre>
  
  <p>The <code>configureStore()</code> looks up if there is already a store created and returns it, otherwise it creates a new store.</p>
  
  <p>For the load procedure, I was thinking something like this would do </p>
  
  <ol>
  <li>Load JSON from user and parse</li>
  <li>Clear localForage (as it would overwrite the initalState)</li>
  <li>Recreate store, with initialState from the user submitted file</li>
  <li>Call ReactDOM.render() again</li>
  </ol>
  
  <p>Is there a better way, perhaps built-in load methods into <code>redux</code> and <code>redux-persist</code> which I missed in the docs?</p>