title: UseStore is async? How to ensure that store-data is loaded completely?
body: <p>I have a serious problem with State Management in React. I am using Zustand and it works pretty well.</p>
  <p>However, when I access the store and try to output it one the console, for example:</p>
  <pre><code>const USER = useStore(state =&gt; state.currentUser) 
  console.log(USER)
  </code></pre>
  <p>the result logged is null. If the page rerenders it is the correct userobject.</p>
  <p>The store is set up as follows:</p>
  <pre><code>import react from &quot;react&quot;;
  import create from &quot;zustand&quot;;
  
  const useStore = create(set =&gt; ({
  
      currentUser: null
  }))
  
  export default useStore
  </code></pre>
  <p>Thus, I suppose that useStore works asynchronously, i.e. updates the variable with the pages next render. Is that correct?
  So, how can I ensure that the store variables are loaded completely, before I continue?</p>
  <p>Hope, the problem is clear to everyone?</p>
  <p>Thanks in advance,</p>
  <p>Wiwi</p>