title: Remember me with redux storage
body: <p>I have <code>userDetails</code> in <code>redux store</code> and I used <code>redux persist</code> with <code>redux storage</code> to save the details after loads page or after closing my app.</p>
  
  <p>The problem is, when I logged in and I don't <code>checked</code> the <code>rememberMe</code> in index.js is checked if <code>!rememberMe</code> and do <code>logOut()</code> right after <code>login</code>.</p>
  
  <p>So I need to check just at the entrance into the app for the first time and if <code>!rememberMe</code> I will call <code>logOut()</code> but if <code>userDetails !== 'emepty'</code> &amp;&amp; <code>rememberMe</code> I will do <code>login()</code> for get valid <code>token</code>.</p>
  
  <p>Why I need to check this it in the first time? because I need to reset the <code>uesrDetails</code> to guest details if <code>!rememberMe</code>.</p>
  
  <p>This is my index.js:</p>
  
  <pre><code>const setBeforeLists = useCallback(
      (lists) =&gt; {
          beforeListsChanged(lists);
      },
      [beforeListsChanged]
  );
  
  const setUserDetails = useCallback(
      (userDetails) =&gt; {
          userDetailsChanged(userDetails);
      },
      [userDetailsChanged]
  );
  
  useEffect(() =&gt; {
  //userDetails.id === 'empty' is guest.
     if (
          userDetails.id !== 'empty' &amp;&amp;
          !userDetails.rememberMe
          ) {
              logOut(setUserDetails, setBeforeLists);
          }
      }, [
          setBeforeLists,
          setUserDetails,
          userDetails
  ]);
  </code></pre>