title: Save and retrieve states with redux-persist - React Native
body: <p>I'm new to react-native and I'm trying for the first time to save the states of my app.</p>
  
  <p>In order to achieve this I've been suggested to use <a href="https://github.com/rt2zz/redux-persist/blob/master/docs/recipes.md" rel="noreferrer">redux-persist</a>. 
  I expected to find more examples and topics about it in the web and I feel that my idea about how redux-persist works is not that limpid.</p>
  
  <p>I've followed the short guide in the github page but once I close and re-open my app I can't see saved states values but I see the default, initial states values.</p>
  
  <p>This is my app.js file:</p>
  
  <pre><code>import React, { Component } from 'react';
  import { AsyncStorage } from 'react-native'
  import { Provider } from 'react-redux';
  import { createStore, applyMiddleware, compose } from 'redux';
  import { persistStore, autoRehydrate } from 'redux-persist';
  import ReduxThunk from 'redux-thunk';
  import reducers from './reducers';
  import Router from './Router';
  
  class App extends Component {
    render() {
      const store = compose(applyMiddleware(ReduxThunk), autoRehydrate())(createStore)(reducers); 
      persistStore(store, {storage: AsyncStorage}, () =&gt; {
          console.log('restored');
      })
      return (
        &lt;Provider store={store}&gt;
          &lt;Router /&gt;
        &lt;/Provider&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  
  <p><strong>Do I need something else?</strong></p>
  
  <p><strong>I'd also like to know how I can <code>console.log</code> all the states values inside the redux-persistor storage.</strong></p>
  
  <p>Thanks in advance</p>